home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / QuickTimeMusic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  85.5 KB  |  2,087 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        QuickTimeMusic.h
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 3.0
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __QUICKTIMEMUSIC__
  19. #define __QUICKTIMEMUSIC__
  20.  
  21. #ifndef __COMPONENTS__
  22. #include <Components.h>
  23. #endif
  24. #ifndef __IMAGECOMPRESSION__
  25. #include <ImageCompression.h>
  26. #endif
  27. #ifndef __MOVIES__
  28. #include <Movies.h>
  29. #endif
  30. #ifndef __QUICKDRAW__
  31. #include <Quickdraw.h>
  32. #endif
  33. #ifndef __VIDEO__
  34. #include <Video.h>
  35. #endif
  36. #ifndef __MACMEMORY__
  37. #include <MacMemory.h>
  38. #endif
  39. #ifndef __SOUND__
  40. #include <Sound.h>
  41. #endif
  42. #ifndef __ENDIAN__
  43. #include <Endian.h>
  44. #endif
  45.  
  46.  
  47.  
  48. #if PRAGMA_ONCE
  49. #pragma once
  50. #endif
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. #if PRAGMA_IMPORT
  57. #pragma import on
  58. #endif
  59.  
  60. #if PRAGMA_STRUCT_ALIGN
  61.     #pragma options align=mac68k
  62. #elif PRAGMA_STRUCT_PACKPUSH
  63.     #pragma pack(push, 2)
  64. #elif PRAGMA_STRUCT_PACK
  65.     #pragma pack(2)
  66. #endif
  67.  
  68.  
  69. enum {
  70.     kaiToneDescType                = FOUR_CHAR_CODE('tone'),
  71.     kaiNoteRequestInfoType        = FOUR_CHAR_CODE('ntrq'),
  72.     kaiKnobListType                = FOUR_CHAR_CODE('knbl'),
  73.     kaiKeyRangeInfoType            = FOUR_CHAR_CODE('sinf'),
  74.     kaiSampleDescType            = FOUR_CHAR_CODE('sdsc'),
  75.     kaiSampleInfoType            = FOUR_CHAR_CODE('smin'),
  76.     kaiSampleDataType            = FOUR_CHAR_CODE('sdat'),
  77.     kaiSampleDataQUIDType        = FOUR_CHAR_CODE('quid'),
  78.     kaiInstInfoType                = FOUR_CHAR_CODE('iinf'),
  79.     kaiPictType                    = FOUR_CHAR_CODE('pict'),
  80.     kaiWriterType                = FOUR_CHAR_CODE('©wrt'),
  81.     kaiCopyrightType            = FOUR_CHAR_CODE('©cpy'),
  82.     kaiOtherStrType                = FOUR_CHAR_CODE('str '),
  83.     kaiInstrumentRefType        = FOUR_CHAR_CODE('iref'),
  84.     kaiInstGMQualityType        = FOUR_CHAR_CODE('qual'),
  85.     kaiLibraryInfoType            = FOUR_CHAR_CODE('linf'),
  86.     kaiLibraryDescType            = FOUR_CHAR_CODE('ldsc')
  87. };
  88.  
  89.  
  90. struct InstLibDescRec {
  91.     Str31                             libIDName;
  92. };
  93. typedef struct InstLibDescRec            InstLibDescRec;
  94.  
  95. struct InstKnobRec {
  96.     BigEndianLong                     number;
  97.     BigEndianLong                     value;
  98. };
  99. typedef struct InstKnobRec                InstKnobRec;
  100.  
  101. enum {
  102.     kInstKnobMissingUnknown        = 0,
  103.     kInstKnobMissingDefault        = (1 << 0)
  104. };
  105.  
  106.  
  107. struct InstKnobList {
  108.     BigEndianLong                     knobCount;
  109.     BigEndianLong                     knobFlags;
  110.     InstKnobRec                     knob[1];
  111. };
  112. typedef struct InstKnobList                InstKnobList;
  113.  
  114. enum {
  115.     kMusicLoopTypeNormal        = 0,
  116.     kMusicLoopTypePalindrome    = 1                                /* back & forth*/
  117. };
  118.  
  119.  
  120. enum {
  121.     instSamplePreProcessFlag    = 1 << 0
  122. };
  123.  
  124.  
  125. struct InstSampleDescRec {
  126.     BigEndianOSType                 dataFormat;
  127.     BigEndianShort                     numChannels;
  128.     BigEndianShort                     sampleSize;
  129.     BigEndianUnsignedFixed             sampleRate;
  130.     BigEndianShort                     sampleDataID;
  131.     BigEndianLong                     offset;                        /* offset within SampleData - this could be just for internal use*/
  132.     BigEndianLong                     numSamples;                    /* this could also just be for internal use, we'll see*/
  133.  
  134.     BigEndianLong                     loopType;
  135.     BigEndianLong                     loopStart;
  136.     BigEndianLong                     loopEnd;
  137.  
  138.     BigEndianLong                     pitchNormal;
  139.     BigEndianLong                     pitchLow;
  140.     BigEndianLong                     pitchHigh;
  141. };
  142. typedef struct InstSampleDescRec        InstSampleDescRec;
  143.  
  144. typedef Handle                             AtomicInstrument;
  145. typedef Ptr                             AtomicInstrumentPtr;
  146.  
  147. enum {
  148.     kQTMIDIComponentType        = FOUR_CHAR_CODE('midi')
  149. };
  150.  
  151.  
  152. enum {
  153.     kOMSComponentSubType        = FOUR_CHAR_CODE('OMS '),
  154.     kFMSComponentSubType        = FOUR_CHAR_CODE('FMS '),
  155.     kMIDIManagerComponentSubType = FOUR_CHAR_CODE('mmgr')
  156. };
  157.  
  158. typedef ComponentInstance                 QTMIDIComponent;
  159.  
  160. enum {
  161.     kMusicPacketPortLost        = 1,                            /* received when application loses the default input port */
  162.     kMusicPacketPortFound        = 2,                            /* received when application gets it back out from under someone else's claim */
  163.     kMusicPacketTimeGap            = 3                                /* data[0] = number of milliseconds to keep the MIDI line silent */
  164. };
  165.  
  166.  
  167. enum {
  168.     kAppleSysexID                = 0x11,                            /* apple sysex is followed by 2-byte command. 0001 is the command for samplesize */
  169.     kAppleSysexCmdSampleSize    = 0x0001,                        /* 21 bit number in 3 midi bytes follows sysex ID and 2 cmd bytes */
  170.     kAppleSysexCmdSampleBreak    = 0x0002,                        /* specifies that the sample should break right here */
  171.     kAppleSysexCmdAtomicInstrument = 0x0010,                    /* contents of atomic instrument handle */
  172.     kAppleSysexCmdDeveloper        = 0x7F00                        /* F0 11 7F 00 ww xx yy zz ... F7 is available for non-Apple developers, where wxyz is unique app signature with 8th bit cleared, unique to developer, and 00 and 7f are reserved */
  173. };
  174.  
  175.  
  176. struct MusicMIDIPacket {
  177.     unsigned short                     length;
  178.     unsigned long                     reserved;                    /* if length zero, then reserved = above enum */
  179.     UInt8                             data[249];
  180. };
  181. typedef struct MusicMIDIPacket            MusicMIDIPacket;
  182. typedef CALLBACK_API( ComponentResult , MusicMIDISendProcPtr )(ComponentInstance self, long refCon, MusicMIDIPacket *mmp);
  183. typedef STACK_UPP_TYPE(MusicMIDISendProcPtr)                     MusicMIDISendUPP;
  184. typedef CALLBACK_API( ComponentResult , MusicMIDIReadHookProcPtr )(MusicMIDIPacket *mp, long myRefCon);
  185. typedef STACK_UPP_TYPE(MusicMIDIReadHookProcPtr)                 MusicMIDIReadHookUPP;
  186.  
  187. enum {
  188.     kSynthesizerConnectionFMS    = 1,                            /* this connection imported from FMS */
  189.     kSynthesizerConnectionMMgr    = 2,                            /* this connection imported from the MIDI Mgr */
  190.     kSynthesizerConnectionOMS    = 4,                            /* this connection imported from OMS */
  191.     kSynthesizerConnectionQT    = 8,                            /* this connection is a QuickTime-only port */
  192.                                                                 /* lowest four bits are mutually exclusive; combinations reserved for future use.*/
  193.     kSynthesizerConnectionUnavailable = 256                        /* port exists, but cannot be used just now */
  194. };
  195.  
  196.  
  197. struct SynthesizerConnections {
  198.     OSType                             clientID;
  199.     OSType                             inputPortID;                /* terminology death: this port is used to SEND to the midi synth */
  200.     OSType                             outputPortID;                /* terminology death: this port receives from a keyboard or other control device */
  201.     long                             midiChannel;                /* The system channel; others are configurable (or the nubus slot number) */
  202.     long                             flags;
  203.     long                             unique;                        /* unique id may be used instead of index, to getinfo and unregister calls */
  204.     long                             reserved1;                    /* should be zero */
  205.     long                             reserved2;                    /* should be zero */
  206. };
  207. typedef struct SynthesizerConnections    SynthesizerConnections;
  208.  
  209. struct QTMIDIPort {
  210.     SynthesizerConnections             portConnections;
  211.     Str63                             portName;
  212. };
  213. typedef struct QTMIDIPort                QTMIDIPort;
  214.  
  215. struct QTMIDIPortList {
  216.     short                             portCount;
  217.     QTMIDIPort                         port[1];
  218. };
  219. typedef struct QTMIDIPortList            QTMIDIPortList;
  220. typedef QTMIDIPortList *                QTMIDIPortListPtr;
  221. typedef QTMIDIPortListPtr *                QTMIDIPortListHandle;
  222. EXTERN_API( ComponentResult )
  223. QTMIDIGetMIDIPorts                (QTMIDIComponent         ci,
  224.                                  QTMIDIPortListHandle *    inputPorts,
  225.                                  QTMIDIPortListHandle *    outputPorts)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0001, 0x7000, 0xA82A);
  226.  
  227. EXTERN_API( ComponentResult )
  228. QTMIDIUseSendPort                (QTMIDIComponent         ci,
  229.                                  long                     portIndex,
  230.                                  long                     inUse)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  231.  
  232. EXTERN_API( ComponentResult )
  233. QTMIDISendMIDI                    (QTMIDIComponent         ci,
  234.                                  long                     portIndex,
  235.                                  MusicMIDIPacket *        mp)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  236.  
  237. EXTERN_API( ComponentResult )
  238. QTMIDIUseReceivePort            (QTMIDIComponent         ci,
  239.                                  long                     portIndex,
  240.                                  MusicMIDIReadHookUPP     readHook,
  241.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0004, 0x7000, 0xA82A);
  242.  
  243.  
  244.  
  245.  
  246. enum {
  247.     kMusicComponentType            = FOUR_CHAR_CODE('musi'),
  248.     kInstrumentComponentType    = FOUR_CHAR_CODE('inst')
  249. };
  250.  
  251.  
  252. enum {
  253.     kSoftSynthComponentSubType    = FOUR_CHAR_CODE('ss  '),
  254.     kGMSynthComponentSubType    = FOUR_CHAR_CODE('gm  ')
  255. };
  256.  
  257.  
  258.  
  259. typedef ComponentInstance                 MusicComponent;
  260. /* MusicSynthesizerFlags*/
  261.  
  262. enum {
  263.     kSynthesizerDynamicVoice    = 1 << 0,                        /* can assign voices on the fly (else, polyphony is very important */
  264.     kSynthesizerUsesMIDIPort    = 1 << 1,                        /* must be patched through MIDI Manager */
  265.     kSynthesizerMicrotone        = 1 << 2,                        /* can play microtonal scales */
  266.     kSynthesizerHasSamples        = 1 << 3,                        /* synthesizer has some use for sampled data */
  267.     kSynthesizerMixedDrums        = 1 << 4,                        /* any part can play drum parts, total = instrument parts */
  268.     kSynthesizerSoftware        = 1 << 5,                        /* implemented in main CPU software == uses cpu cycles */
  269.     kSynthesizerHardware        = 1 << 6,                        /* is a hardware device (such as nubus, or maybe DSP?) */
  270.     kSynthesizerDynamicChannel    = 1 << 7,                        /* can move any part to any channel or disable each part. (else we assume it lives on all channels in masks) */
  271.     kSynthesizerHogsSystemChannel = 1 << 8,                        /* can be channelwise dynamic, but always responds on its system channel */
  272.     kSynthesizerHasSystemChannel = 1 << 9,                        /* has some "system channel" notion to distinguish it from multiple instances of the same device (GM devices dont) */
  273.     kSynthesizerSlowSetPart        = 1 << 10,                        /* SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes */
  274.     kSynthesizerOffline            = 1 << 12,                        /* can enter an offline synthesis mode */
  275.     kSynthesizerGM                = 1 << 14,                        /* synth is a GM device */
  276.     kSynthesizerDLS                = 1 << 15,                        /* synth supports DLS level 1 */
  277.     kSynthesizerSoundLocalization = 1 << 16                        /* synth supports extremely baroque, nonstandard, and proprietary "apple game sprockets" localization parameter set */
  278. };
  279.  
  280. /*
  281.  * Note that these controller numbers
  282.  * are _not_ identical to the MIDI controller numbers.
  283.  * These are _signed_ 8.8 values, and the LSB's are
  284.  * always sent to a MIDI device. Controllers 32-63 are
  285.  * reserved (for MIDI, they are LSB's for 0-31, but we
  286.  * always send both).
  287.  *
  288.  * The full range, therefore, is -128.00 to 127.7f.
  289.  *
  290.  * _Excepting_ _volume_, all controls default to zero.
  291.  *
  292.  * Pitch bend is specified in fractional semitones! No
  293.  * more "pitch bend range" nonsense. You can bend as far
  294.  * as you want, any time you want.
  295.  */
  296. typedef SInt32                             MusicController;
  297.  
  298. enum {
  299.     kControllerModulationWheel    = 1,
  300.     kControllerBreath            = 2,
  301.     kControllerFoot                = 4,
  302.     kControllerPortamentoTime    = 5,                            /* time in 8.8 seconds, portamento on/off is omitted, 0 time = 'off' */
  303.     kControllerVolume            = 7,                            /* main volume control */
  304.     kControllerBalance            = 8,
  305.     kControllerPan                = 10,                            /* 0 - "default", 1 - n: positioned in output 1-n (incl fractions) */
  306.     kControllerExpression        = 11,                            /* secondary volume control */
  307.     kControllerLever1            = 16,                            /* general purpose controllers */
  308.     kControllerLever2            = 17,                            /* general purpose controllers */
  309.     kControllerLever3            = 18,                            /* general purpose controllers */
  310.     kControllerLever4            = 19,                            /* general purpose controllers */
  311.     kControllerLever5            = 80,                            /* general purpose controllers */
  312.     kControllerLever6            = 81,                            /* general purpose controllers */
  313.     kControllerLever7            = 82,                            /* general purpose controllers */
  314.     kControllerLever8            = 83,                            /* general purpose controllers */
  315.     kControllerPitchBend        = 32,                            /* positive & negative semitones, with 8 bits fraction, same units as transpose controllers*/
  316.     kControllerAfterTouch        = 33,                            /* aka channel pressure */
  317.     kControllerPartTranspose    = 40,                            /* identical to pitchbend, for overall part xpose */
  318.     kControllerTuneTranspose    = 41,                            /* another pitchbend, for "song global" pitch offset */
  319.     kControllerPartVolume        = 42,                            /* another volume control, passed right down from note allocator part volume */
  320.     kControllerTuneVolume        = 43,                            /* another volume control, used for "song global" volume - since we share one synthesizer across multiple tuneplayers*/
  321.     kControllerSustain            = 64,                            /* boolean - positive for on, 0 or negative off */
  322.     kControllerPortamento        = 65,                            /* boolean*/
  323.     kControllerSostenuto        = 66,                            /* boolean */
  324.     kControllerSoftPedal        = 67,                            /* boolean */
  325.     kControllerReverb            = 91,
  326.     kControllerTremolo            = 92,
  327.     kControllerChorus            = 93,
  328.     kControllerCeleste            = 94,
  329.     kControllerPhaser            = 95,
  330.     kControllerEditPart            = 113,                            /* last 16 controllers 113-128 and above are global controllers which respond on part zero */
  331.     kControllerMasterTune        = 114,
  332.     kControllerMasterTranspose    = 114,                            /* preferred*/
  333.     kControllerMasterVolume        = 115,
  334.     kControllerMasterCPULoad    = 116,
  335.     kControllerMasterPolyphony    = 117,
  336.     kControllerMasterFeatures    = 118
  337. };
  338.  
  339.  
  340. /* ID's of knobs supported by the QuickTime Music Synthesizer built into QuickTime*/
  341.  
  342.  
  343. enum {
  344.     kQTMSKnobStartID            = 0x02000000,
  345.     kQTMSKnobVolumeAttackTimeID    = 0x02000001,
  346.     kQTMSKnobVolumeDecayTimeID    = 0x02000002,
  347.     kQTMSKnobVolumeSustainLevelID = 0x02000003,
  348.     kQTMSKnobVolumeRelease1RateID = 0x02000004,
  349.     kQTMSKnobVolumeDecayKeyScalingID = 0x02000005,
  350.     kQTMSKnobVolumeReleaseTimeID = 0x02000006,
  351.     kQTMSKnobVolumeLFODelayID    = 0x02000007,
  352.     kQTMSKnobVolumeLFORampTimeID = 0x02000008,
  353.     kQTMSKnobVolumeLFOPeriodID    = 0x02000009,
  354.     kQTMSKnobVolumeLFOShapeID    = 0x0200000A,
  355.     kQTMSKnobVolumeLFODepthID    = 0x0200000B,
  356.     kQTMSKnobVolumeOverallID    = 0x0200000C,
  357.     kQTMSKnobVolumeVelocity127ID = 0x0200000D,
  358.     kQTMSKnobVolumeVelocity96ID    = 0x0200000E,
  359.     kQTMSKnobVolumeVelocity64ID    = 0x0200000F,
  360.     kQTMSKnobVolumeVelocity32ID    = 0x02000010,
  361.     kQTMSKnobVolumeVelocity16ID    = 0x02000011,                    /* Pitch related knobs*/
  362.     kQTMSKnobPitchTransposeID    = 0x02000012,
  363.     kQTMSKnobPitchLFODelayID    = 0x02000013,
  364.     kQTMSKnobPitchLFORampTimeID    = 0x02000014,
  365.     kQTMSKnobPitchLFOPeriodID    = 0x02000015,
  366.     kQTMSKnobPitchLFOShapeID    = 0x02000016,
  367.     kQTMSKnobPitchLFODepthID    = 0x02000017,
  368.     kQTMSKnobPitchLFOQuantizeID    = 0x02000018,                    /* Stereo related knobs*/
  369.     kQTMSKnobStereoDefaultPanID    = 0x02000019,
  370.     kQTMSKnobStereoPositionKeyScalingID = 0x0200001A,
  371.     kQTMSKnobPitchLFOOffsetID    = 0x0200001B,
  372.     kQTMSKnobExclusionGroupID    = 0x0200001C,                    /* Misc knobs, late additions*/
  373.     kQTMSKnobSustainTimeID        = 0x0200001D,
  374.     kQTMSKnobSustainInfiniteID    = 0x0200001E,
  375.     kQTMSKnobVolumeLFOStereoID    = 0x0200001F,
  376.     kQTMSKnobVelocityLowID        = 0x02000020,
  377.     kQTMSKnobVelocityHighID        = 0x02000021,
  378.     kQTMSKnobVelocitySensitivityID = 0x02000022,
  379.     kQTMSKnobPitchSensitivityID    = 0x02000023,
  380.     kQTMSKnobVolumeLFODepthFromWheelID = 0x02000024,
  381.     kQTMSKnobPitchLFODepthFromWheelID = 0x02000025,                /* Volume Env again*/
  382.     kQTMSKnobVolumeExpOptionsID    = 0x02000026,                    /* Env1*/
  383.     kQTMSKnobEnv1AttackTimeID    = 0x02000027,
  384.     kQTMSKnobEnv1DecayTimeID    = 0x02000028,
  385.     kQTMSKnobEnv1SustainLevelID    = 0x02000029,
  386.     kQTMSKnobEnv1SustainTimeID    = 0x0200002A,
  387.     kQTMSKnobEnv1SustainInfiniteID = 0x0200002B,
  388.     kQTMSKnobEnv1ReleaseTimeID    = 0x0200002C,
  389.     kQTMSKnobEnv1ExpOptionsID    = 0x0200002D,                    /* Env2*/
  390.     kQTMSKnobEnv2AttackTimeID    = 0x0200002E,
  391.     kQTMSKnobEnv2DecayTimeID    = 0x0200002F,
  392.     kQTMSKnobEnv2SustainLevelID    = 0x02000030,
  393.     kQTMSKnobEnv2SustainTimeID    = 0x02000031,
  394.     kQTMSKnobEnv2SustainInfiniteID = 0x02000032,
  395.     kQTMSKnobEnv2ReleaseTimeID    = 0x02000033,
  396.     kQTMSKnobEnv2ExpOptionsID    = 0x02000034,                    /* Pitch Env*/
  397.     kQTMSKnobPitchEnvelopeID    = 0x02000035,
  398.     kQTMSKnobPitchEnvelopeDepthID = 0x02000036,                    /* Filter*/
  399.     kQTMSKnobFilterKeyFollowID    = 0x02000037,
  400.     kQTMSKnobFilterTransposeID    = 0x02000038,
  401.     kQTMSKnobFilterQID            = 0x02000039,
  402.     kQTMSKnobFilterFrequencyEnvelopeID = 0x0200003A,
  403.     kQTMSKnobFilterFrequencyEnvelopeDepthID = 0x0200003B,
  404.     kQTMSKnobFilterQEnvelopeID    = 0x0200003C,
  405.     kQTMSKnobFilterQEnvelopeDepthID = 0x0200003D,                /* Reverb Threshhold*/
  406.     kQTMSKnobReverbThresholdID    = 0x0200003E,
  407.     kQTMSKnobVolumeAttackVelScalingID = 0x0200003F,
  408.     kQTMSKnobLastIDPlus1        = 0x02000040
  409. };
  410.  
  411.  
  412.  
  413.  
  414.  
  415. enum {
  416.     kControllerMaximum            = 0x00007FFF,                    /* +01111111.11111111 */
  417.     kControllerMinimum            = (long)0xFFFF8000                /* -10000000.00000000 */
  418. };
  419.  
  420.  
  421. struct SynthesizerDescription {
  422.     OSType                             synthesizerType;            /* synthesizer type (must be same as component subtype) */
  423.     Str31                             name;                        /* text name of synthesizer type */
  424.     unsigned long                     flags;                        /* from the above enum */
  425.     unsigned long                     voiceCount;                    /* maximum polyphony */
  426.  
  427.     unsigned long                     partCount;                    /* maximum multi-timbrality (and midi channels) */
  428.     unsigned long                     instrumentCount;            /* non gm, built in (rom) instruments only */
  429.     unsigned long                     modifiableInstrumentCount;    /* plus n-more are user modifiable */
  430.     unsigned long                     channelMask;                /* (midi device only) which channels device always uses */
  431.  
  432.     unsigned long                     drumPartCount;                /* maximum multi-timbrality of drum parts */
  433.     unsigned long                     drumCount;                    /* non gm, built in (rom) drumkits only */
  434.     unsigned long                     modifiableDrumCount;        /* plus n-more are user modifiable */
  435.     unsigned long                     drumChannelMask;            /* (midi device only) which channels device always uses */
  436.  
  437.     unsigned long                     outputCount;                /* number of audio outputs (usually two) */
  438.     unsigned long                     latency;                    /* response time in µSec */
  439.  
  440.     unsigned long                     controllers[4];                /* array of 128 bits */
  441.     unsigned long                     gmInstruments[4];            /* array of 128 bits */
  442.     unsigned long                     gmDrums[4];                    /* array of 128 bits */
  443. };
  444. typedef struct SynthesizerDescription    SynthesizerDescription;
  445.  
  446. enum {
  447.     kVoiceCountDynamic            = -1                            /* constant to use to specify dynamic voicing */
  448. };
  449.  
  450.  
  451.  
  452. struct ToneDescription {
  453.     BigEndianOSType                 synthesizerType;            /* synthesizer type */
  454.     Str31                             synthesizerName;            /* name of instantiation of synth */
  455.     Str31                             instrumentName;                /* preferred name for human use */
  456.     BigEndianLong                     instrumentNumber;            /* inst-number used if synth-name matches */
  457.     BigEndianLong                     gmNumber;                    /* Best matching general MIDI number */
  458. };
  459. typedef struct ToneDescription            ToneDescription;
  460.  
  461. enum {
  462.     kFirstGMInstrument            = 0x00000001,
  463.     kLastGMInstrument            = 0x00000080,
  464.     kFirstGSInstrument            = 0x00000081,
  465.     kLastGSInstrument            = 0x00003FFF,
  466.     kFirstDrumkit                = 0x00004000,                    /* (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! */
  467.     kLastDrumkit                = 0x00004080,
  468.     kFirstROMInstrument            = 0x00008000,
  469.     kLastROMInstrument            = 0x0000FFFF,
  470.     kFirstUserInstrument        = 0x00010000,
  471.     kLastUserInstrument            = 0x0001FFFF
  472. };
  473.  
  474. /* InstrumentMatch*/
  475.  
  476. enum {
  477.     kInstrumentMatchSynthesizerType = 1,
  478.     kInstrumentMatchSynthesizerName = 2,
  479.     kInstrumentMatchName        = 4,
  480.     kInstrumentMatchNumber        = 8,
  481.     kInstrumentMatchGMNumber    = 16,
  482.     kInstrumentMatchGSNumber    = 32
  483. };
  484.  
  485. /* KnobFlags*/
  486.  
  487. enum {
  488.     kKnobBasic                    = 8,                            /* knob shows up in certain simplified lists of knobs */
  489.     kKnobReadOnly                = 16,                            /* knob value cannot be changed by user or with a SetKnob call */
  490.     kKnobInterruptUnsafe        = 32,                            /* only alter this knob from foreground task time (may access toolbox) */
  491.     kKnobKeyrangeOverride        = 64,                            /* knob can be overridden within a single keyrange (software synth only) */
  492.     kKnobGroupStart                = 128,                            /* knob is first in some logical group of knobs */
  493.     kKnobFixedPoint8            = 1024,
  494.     kKnobFixedPoint16            = 2048,                            /* One of these may be used at a time. */
  495.     kKnobTypeNumber                = 0 << 12,
  496.     kKnobTypeGroupName            = 1 << 12,                        /* "knob" is really a group name for display purposes */
  497.     kKnobTypeBoolean            = 2 << 12,                        /* if range is greater than 1, its a multi-checkbox field */
  498.     kKnobTypeNote                = 3 << 12,                        /* knob range is equivalent to MIDI keys */
  499.     kKnobTypePan                = 4 << 12,                        /* range goes left/right (lose this? ) */
  500.     kKnobTypeInstrument            = 5 << 12,                        /* knob value = reference to another instrument number */
  501.     kKnobTypeSetting            = 6 << 12,                        /* knob value is 1 of n different things (eg, fm algorithms) popup menu */
  502.     kKnobTypeMilliseconds        = 7 << 12,                        /* knob is a millisecond time range */
  503.     kKnobTypePercentage            = 8 << 12,                        /* knob range is displayed as a Percentage */
  504.     kKnobTypeHertz                = 9 << 12,                        /* knob represents frequency */
  505.     kKnobTypeButton                = 10 << 12                        /* momentary trigger push button */
  506. };
  507.  
  508.  
  509.  
  510. enum {
  511.     kUnknownKnobValue            = 0x7FFFFFFF,                    /* a knob with this value means, we don't know it. */
  512.     kDefaultKnobValue            = 0x7FFFFFFE                    /* used to SET a knob to its default value. */
  513. };
  514.  
  515.  
  516. struct KnobDescription {
  517.     Str63                             name;
  518.     long                             lowValue;
  519.     long                             highValue;
  520.     long                             defaultValue;                /* a default instrument is made of all default values */
  521.     long                             flags;
  522.     long                             knobID;
  523. };
  524. typedef struct KnobDescription            KnobDescription;
  525.  
  526. struct GCInstrumentData {
  527.     ToneDescription                 tone;
  528.     long                             knobCount;
  529.     long                             knob[1];
  530. };
  531. typedef struct GCInstrumentData            GCInstrumentData;
  532. typedef GCInstrumentData *                GCInstrumentDataPtr;
  533. typedef GCInstrumentDataPtr *            GCInstrumentDataHandle;
  534.  
  535. struct InstrumentAboutInfo {
  536.     PicHandle                         p;
  537.     Str255                             author;
  538.     Str255                             copyright;
  539.     Str255                             other;
  540. };
  541. typedef struct InstrumentAboutInfo        InstrumentAboutInfo;
  542.  
  543.  
  544. enum {
  545.     notImplementedMusicErr        = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))),
  546.     cantSendToSynthesizerErr    = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))),
  547.     cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))),
  548.     illegalVoiceAllocationErr    = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))),
  549.     illegalPartErr                = (0x80000000 | (0xFFFF & (illegalPartOSErr))),
  550.     illegalChannelErr            = (0x80000000 | (0xFFFF & (illegalChannelOSErr))),
  551.     illegalKnobErr                = (0x80000000 | (0xFFFF & (illegalKnobOSErr))),
  552.     illegalKnobValueErr            = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))),
  553.     illegalInstrumentErr        = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))),
  554.     illegalControllerErr        = (0x80000000 | (0xFFFF & (illegalControllerOSErr))),
  555.     midiManagerAbsentErr        = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))),
  556.     synthesizerNotRespondingErr    = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))),
  557.     synthesizerErr                = (0x80000000 | (0xFFFF & (synthesizerOSErr))),
  558.     illegalNoteChannelErr        = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))),
  559.     noteChannelNotAllocatedErr    = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))),
  560.     tunePlayerFullErr            = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))),
  561.     tuneParseErr                = (0x80000000 | (0xFFFF & (tuneParseOSErr)))
  562. };
  563.  
  564.  
  565. enum {
  566.     kGetAtomicInstNoExpandedSamples = 1 << 0,
  567.     kGetAtomicInstNoOriginalSamples = 1 << 1,
  568.     kGetAtomicInstNoSamples        = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOriginalSamples,
  569.     kGetAtomicInstNoKnobList    = 1 << 2,
  570.     kGetAtomicInstNoInstrumentInfo = 1 << 3,
  571.     kGetAtomicInstOriginalKnobList = 1 << 4,
  572.     kGetAtomicInstAllKnobs        = 1 << 5                        /* return even those that are set to default*/
  573. };
  574.  
  575. /*
  576.    For non-gm instruments, instrument number of tone description == 0
  577.    If you want to speed up while running, slam the inst num with what Get instrument number returns
  578.    All missing knobs are slammed to the default value
  579. */
  580.  
  581. enum {
  582.     kSetAtomicInstKeepOriginalInstrument = 1 << 0,
  583.     kSetAtomicInstShareAcrossParts = 1 << 1,                    /* inst disappears when app goes away*/
  584.     kSetAtomicInstCallerTosses    = 1 << 2,                        /* the caller isn't keeping a copy around (for NASetAtomicInstrument)*/
  585.     kSetAtomicInstCallerGuarantees = 1 << 3,                    /* the caller guarantees a copy is around*/
  586.     kSetAtomicInstInterruptSafe    = 1 << 4,                        /* dont move memory at this time (but process at next task time)*/
  587.     kSetAtomicInstDontPreprocess = 1 << 7                        /* perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic*/
  588. };
  589.  
  590.  
  591. enum {
  592.     kInstrumentNamesModifiable    = 1,
  593.     kInstrumentNamesBoth        = 2
  594. };
  595.  
  596. /*
  597.  * Structures specific to the GenericMusicComponent
  598.  */
  599.  
  600.  
  601. enum {
  602.     kGenericMusicComponentSubtype = FOUR_CHAR_CODE('gene')
  603. };
  604.  
  605.  
  606. struct GenericKnobDescription {
  607.     KnobDescription                 kd;
  608.     long                             hw1;                        /* driver defined */
  609.     long                             hw2;                        /* driver defined */
  610.     long                             hw3;                        /* driver defined */
  611.     long                             settingsID;                    /* resource ID list for boolean and popup names */
  612. };
  613. typedef struct GenericKnobDescription    GenericKnobDescription;
  614.  
  615. struct GenericKnobDescriptionList {
  616.     long                             knobCount;
  617.     GenericKnobDescription             knob[1];
  618. };
  619. typedef struct GenericKnobDescriptionList GenericKnobDescriptionList;
  620. typedef GenericKnobDescriptionList *    GenericKnobDescriptionListPtr;
  621. typedef GenericKnobDescriptionListPtr *    GenericKnobDescriptionListHandle;
  622. /* knobTypes for MusicDerivedSetKnob */
  623.  
  624. enum {
  625.     kGenericMusicKnob            = 1,
  626.     kGenericMusicInstrumentKnob    = 2,
  627.     kGenericMusicDrumKnob        = 3,
  628.     kGenericMusicGlobalController = 4
  629. };
  630.  
  631.  
  632.  
  633.  
  634. enum {
  635.     kGenericMusicResFirst        = 0,
  636.     kGenericMusicResMiscStringList = 1,                            /* STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother */
  637.     kGenericMusicResMiscLongList = 2,                            /* Long various params, see list below */
  638.     kGenericMusicResInstrumentList = 3,                            /* NmLs of names and shorts, categories prefixed by '••' */
  639.     kGenericMusicResDrumList    = 4,                            /* NmLs of names and shorts */
  640.     kGenericMusicResInstrumentKnobDescriptionList = 5,            /* Knob */
  641.     kGenericMusicResDrumKnobDescriptionList = 6,                /* Knob */
  642.     kGenericMusicResKnobDescriptionList = 7,                    /* Knob */
  643.     kGenericMusicResBitsLongList = 8,                            /* Long back to back bitmaps of controllers, gminstruments, and drums */
  644.     kGenericMusicResModifiableInstrumentHW = 9,                    /* Shrt same as the hw shorts trailing the instrument names, a shortlist */
  645.     kGenericMusicResGMTranslation = 10,                            /* Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers) */
  646.     kGenericMusicResROMInstrumentData = 11,                        /* knob lists for ROM instruments, so the knob values may be known */
  647.     kGenericMusicResAboutPICT    = 12,                            /* picture for aboutlist. must be present for GetAbout call to work */
  648.     kGenericMusicResLast        = 13
  649. };
  650.  
  651. /* elements of the misc long list */
  652.  
  653. enum {
  654.     kGenericMusicMiscLongFirst    = 0,
  655.     kGenericMusicMiscLongVoiceCount = 1,
  656.     kGenericMusicMiscLongPartCount = 2,
  657.     kGenericMusicMiscLongModifiableInstrumentCount = 3,
  658.     kGenericMusicMiscLongChannelMask = 4,
  659.     kGenericMusicMiscLongDrumPartCount = 5,
  660.     kGenericMusicMiscLongModifiableDrumCount = 6,
  661.     kGenericMusicMiscLongDrumChannelMask = 7,
  662.     kGenericMusicMiscLongOutputCount = 8,
  663.     kGenericMusicMiscLongLatency = 9,
  664.     kGenericMusicMiscLongFlags    = 10,
  665.     kGenericMusicMiscLongFirstGMHW = 11,                        /* number to add to locate GM main instruments */
  666.     kGenericMusicMiscLongFirstGMDrumHW = 12,                    /* number to add to locate GM drumkits */
  667.     kGenericMusicMiscLongFirstUserHW = 13,                        /* First hw number of user instruments (presumed sequential) */
  668.     kGenericMusicMiscLongLast    = 14
  669. };
  670.  
  671.  
  672. struct GCPart {
  673.     long                             hwInstrumentNumber;            /* internal number of recalled instrument */
  674.     short                             controller[128];            /* current values for all controllers */
  675.     long                             volume;                        /* ctrl 7 is special case */
  676.     long                             polyphony;
  677.     long                             midiChannel;                /* 1-16 if in use */
  678.     GCInstrumentData                 id;                            /* ToneDescription & knoblist, uncertain length */
  679. };
  680. typedef struct GCPart                    GCPart;
  681. /*
  682.  * Calls specific to the GenericMusicComponent
  683.  */
  684.  
  685. enum {
  686.     kMusicGenericRange            = 0x0100,
  687.     kMusicDerivedRange            = 0x0200
  688. };
  689.  
  690. /*
  691.  * Flags in GenericMusicConfigure call
  692.  */
  693.  
  694. enum {
  695.     kGenericMusicDoMIDI            = 1 << 0,                        /* implement normal MIDI messages for note, controllers, and program changes 0-127 */
  696.     kGenericMusicBank0            = 1 << 1,                        /* implement instrument bank changes on controller 0 */
  697.     kGenericMusicBank32            = 1 << 2,                        /* implement instrument bank changes on controller 32 */
  698.     kGenericMusicErsatzMIDI        = 1 << 3,                        /* construct MIDI packets, but send them to the derived component */
  699.     kGenericMusicCallKnobs        = 1 << 4,                        /* call the derived component with special knob format call */
  700.     kGenericMusicCallParts        = 1 << 5,                        /* call the derived component with special part format call */
  701.     kGenericMusicCallInstrument    = 1 << 6,                        /* call MusicDerivedSetInstrument for MusicSetInstrument calls */
  702.     kGenericMusicCallNumber        = 1 << 7,                        /* call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff */
  703.     kGenericMusicCallROMInstrument = 1 << 8,                    /* call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource */
  704.     kGenericMusicAllDefaults    = 1 << 9                        /* indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules */
  705. };
  706.  
  707.  
  708.  
  709.  
  710.  
  711. typedef CALLBACK_API( ComponentResult , MusicOfflineDataProcPtr )(Ptr SoundData, long numBytes, long myRefCon);
  712. typedef STACK_UPP_TYPE(MusicOfflineDataProcPtr)                 MusicOfflineDataUPP;
  713.  
  714. struct OfflineSampleType {
  715.     unsigned long                     numChannels;                /*number of channels,  ie mono = 1*/
  716.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  717.     unsigned short                     sampleSize;                    /*number of bits in sample*/
  718. };
  719. typedef struct OfflineSampleType        OfflineSampleType;
  720.  
  721. struct InstrumentInfoRecord {
  722.     long                             instrumentNumber;            /* instrument number (if 0, name is a catagory)*/
  723.     long                             flags;                        /* show in picker, etc.*/
  724.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  725.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  726. };
  727. typedef struct InstrumentInfoRecord        InstrumentInfoRecord;
  728.  
  729. struct InstrumentInfoList {
  730.     long                             recordCount;
  731.     Handle                             toneNames;                    /* name from tone description*/
  732.     QTAtomContainer                 itxtNames;                    /* itxt/name atoms for instruments*/
  733.     InstrumentInfoRecord             info[1];
  734. };
  735. typedef struct InstrumentInfoList        InstrumentInfoList;
  736. typedef InstrumentInfoList *            InstrumentInfoListPtr;
  737. typedef InstrumentInfoListPtr *            InstrumentInfoListHandle;
  738. EXTERN_API( ComponentResult )
  739. MusicGetDescription                (MusicComponent         mc,
  740.                                  SynthesizerDescription * sd)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  741.  
  742. EXTERN_API( ComponentResult )
  743. MusicGetPart                    (MusicComponent         mc,
  744.                                  long                     part,
  745.                                  long *                    midiChannel,
  746.                                  long *                    polyphony)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  747.  
  748. EXTERN_API( ComponentResult )
  749. MusicSetPart                    (MusicComponent         mc,
  750.                                  long                     part,
  751.                                  long                     midiChannel,
  752.                                  long                     polyphony)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  753.  
  754. EXTERN_API( ComponentResult )
  755. MusicSetPartInstrumentNumber    (MusicComponent         mc,
  756.                                  long                     part,
  757.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  758.  
  759. #if OLDROUTINENAMES
  760. #define MusicSetInstrumentNumber(ci,part,instrumentNumber) MusicSetPartInstrumentNumber(ci, part,instrumentNumber)
  761. #endif
  762.  
  763. EXTERN_API( ComponentResult )
  764. MusicGetPartInstrumentNumber    (MusicComponent         mc,
  765.                                  long                     part)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  766.  
  767. EXTERN_API( ComponentResult )
  768. MusicStorePartInstrument        (MusicComponent         mc,
  769.                                  long                     part,
  770.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  771.  
  772.  
  773. EXTERN_API( ComponentResult )
  774. MusicGetPartAtomicInstrument    (MusicComponent         mc,
  775.                                  long                     part,
  776.                                  AtomicInstrument *        ai,
  777.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0009, 0x7000, 0xA82A);
  778.  
  779. EXTERN_API( ComponentResult )
  780. MusicSetPartAtomicInstrument    (MusicComponent         mc,
  781.                                  long                     part,
  782.                                  AtomicInstrumentPtr     aiP,
  783.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x000A, 0x7000, 0xA82A);
  784.  
  785.  
  786. /* Obsolete calls*/
  787. EXTERN_API( ComponentResult )
  788. MusicGetInstrumentKnobDescriptionObsolete (MusicComponent  mc,
  789.                                  long                     knobIndex,
  790.                                  void *                    mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
  791.  
  792. EXTERN_API( ComponentResult )
  793. MusicGetDrumKnobDescriptionObsolete (MusicComponent     mc,
  794.                                  long                     knobIndex,
  795.                                  void *                    mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000E, 0x7000, 0xA82A);
  796.  
  797. EXTERN_API( ComponentResult )
  798. MusicGetKnobDescriptionObsolete    (MusicComponent         mc,
  799.                                  long                     knobIndex,
  800.                                  void *                    mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  801.  
  802. EXTERN_API( ComponentResult )
  803. MusicGetPartKnob                (MusicComponent         mc,
  804.                                  long                     part,
  805.                                  long                     knobID)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  806.  
  807. EXTERN_API( ComponentResult )
  808. MusicSetPartKnob                (MusicComponent         mc,
  809.                                  long                     part,
  810.                                  long                     knobID,
  811.                                  long                     knobValue)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  812.  
  813. EXTERN_API( ComponentResult )
  814. MusicGetKnob                    (MusicComponent         mc,
  815.                                  long                     knobID)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  816.  
  817. EXTERN_API( ComponentResult )
  818. MusicSetKnob                    (MusicComponent         mc,
  819.                                  long                     knobID,
  820.                                  long                     knobValue)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  821.  
  822. EXTERN_API( ComponentResult )
  823. MusicGetPartName                (MusicComponent         mc,
  824.                                  long                     part,
  825.                                  StringPtr                 name)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0014, 0x7000, 0xA82A);
  826.  
  827. EXTERN_API( ComponentResult )
  828. MusicSetPartName                (MusicComponent         mc,
  829.                                  long                     part,
  830.                                  StringPtr                 name)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  831.  
  832. EXTERN_API( ComponentResult )
  833. MusicFindTone                    (MusicComponent         mc,
  834.                                  ToneDescription *        td,
  835.                                  long *                    libraryIndexOut,
  836.                                  unsigned long *        fit)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0016, 0x7000, 0xA82A);
  837.  
  838. EXTERN_API( ComponentResult )
  839. MusicPlayNote                    (MusicComponent         mc,
  840.                                  long                     part,
  841.                                  long                     pitch,
  842.                                  long                     velocity)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  843.  
  844. EXTERN_API( ComponentResult )
  845. MusicResetPart                    (MusicComponent         mc,
  846.                                  long                     part)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  847.  
  848. EXTERN_API( ComponentResult )
  849. MusicSetPartController            (MusicComponent         mc,
  850.                                  long                     part,
  851.                                  MusicController         controllerNumber,
  852.                                  long                     controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  853.  
  854. #if OLDROUTINENAMES
  855. #define MusicSetController(ci,part,controllerNumber,controllerValue) MusicSetPartController(ci, part,controllerNumber,controllerValue)
  856. #endif
  857.  
  858. EXTERN_API( ComponentResult )
  859. MusicGetPartController            (MusicComponent         mc,
  860.                                  long                     part,
  861.                                  MusicController         controllerNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  862.  
  863. EXTERN_API( ComponentResult )
  864. MusicGetMIDIProc                (MusicComponent         mc,
  865.                                  MusicMIDISendUPP *        midiSendProc,
  866.                                  long *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  867.  
  868. EXTERN_API( ComponentResult )
  869. MusicSetMIDIProc                (MusicComponent         mc,
  870.                                  MusicMIDISendUPP         midiSendProc,
  871.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  872.  
  873. EXTERN_API( ComponentResult )
  874. MusicGetInstrumentNames            (MusicComponent         mc,
  875.                                  long                     modifiableInstruments,
  876.                                  Handle *                instrumentNames,
  877.                                  Handle *                instrumentCategoryLasts,
  878.                                  Handle *                instrumentCategoryNames)            FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  879.  
  880. EXTERN_API( ComponentResult )
  881. MusicGetDrumNames                (MusicComponent         mc,
  882.                                  long                     modifiableInstruments,
  883.                                  Handle *                instrumentNumbers,
  884.                                  Handle *                instrumentNames)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x001E, 0x7000, 0xA82A);
  885.  
  886. EXTERN_API( ComponentResult )
  887. MusicGetMasterTune                (MusicComponent         mc)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x001F, 0x7000, 0xA82A);
  888.  
  889. EXTERN_API( ComponentResult )
  890. MusicSetMasterTune                (MusicComponent         mc,
  891.                                  long                     masterTune)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  892.  
  893.  
  894. EXTERN_API( ComponentResult )
  895. MusicGetInstrumentAboutInfo        (MusicComponent         mc,
  896.                                  long                     part,
  897.                                  InstrumentAboutInfo *    iai)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  898.  
  899. EXTERN_API( ComponentResult )
  900. MusicGetDeviceConnection        (MusicComponent         mc,
  901.                                  long                     index,
  902.                                  long *                    id1,
  903.                                  long *                    id2)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0023, 0x7000, 0xA82A);
  904.  
  905. EXTERN_API( ComponentResult )
  906. MusicUseDeviceConnection        (MusicComponent         mc,
  907.                                  long                     id1,
  908.                                  long                     id2)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  909.  
  910. EXTERN_API( ComponentResult )
  911. MusicGetKnobSettingStrings        (MusicComponent         mc,
  912.                                  long                     knobIndex,
  913.                                  long                     isGlobal,
  914.                                  Handle *                settingsNames,
  915.                                  Handle *                settingsCategoryLasts,
  916.                                  Handle *                settingsCategoryNames)                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0025, 0x7000, 0xA82A);
  917.  
  918. EXTERN_API( ComponentResult )
  919. MusicGetMIDIPorts                (MusicComponent         mc,
  920.                                  long *                    inputPortCount,
  921.                                  long *                    outputPortCount)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0026, 0x7000, 0xA82A);
  922.  
  923. EXTERN_API( ComponentResult )
  924. MusicSendMIDI                    (MusicComponent         mc,
  925.                                  long                     portIndex,
  926.                                  MusicMIDIPacket *        mp)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0027, 0x7000, 0xA82A);
  927.  
  928. EXTERN_API( ComponentResult )
  929. MusicReceiveMIDI                (MusicComponent         mc,
  930.                                  MusicMIDIReadHookUPP     readHook,
  931.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0028, 0x7000, 0xA82A);
  932.  
  933. EXTERN_API( ComponentResult )
  934. MusicStartOffline                (MusicComponent         mc,
  935.                                  unsigned long *        numChannels,
  936.                                  UnsignedFixed *        sampleRate,
  937.                                  unsigned short *        sampleSize,
  938.                                  MusicOfflineDataUPP     dataProc,
  939.                                  long                     dataProcRefCon)                        FIVEWORDINLINE(0x2F3C, 0x0014, 0x0029, 0x7000, 0xA82A);
  940.  
  941. EXTERN_API( ComponentResult )
  942. MusicSetOfflineTimeTo            (MusicComponent         mc,
  943.                                  long                     newTimeStamp)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  944.  
  945. EXTERN_API( ComponentResult )
  946. MusicGetInstrumentKnobDescription (MusicComponent         mc,
  947.                                  long                     knobIndex,
  948.                                  KnobDescription *        mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  949.  
  950. EXTERN_API( ComponentResult )
  951. MusicGetDrumKnobDescription        (MusicComponent         mc,
  952.                                  long                     knobIndex,
  953.                                  KnobDescription *        mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  954.  
  955. EXTERN_API( ComponentResult )
  956. MusicGetKnobDescription            (MusicComponent         mc,
  957.                                  long                     knobIndex,
  958.                                  KnobDescription *        mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002D, 0x7000, 0xA82A);
  959.  
  960. EXTERN_API( ComponentResult )
  961. MusicGetInfoText                (MusicComponent         mc,
  962.                                  long                     selector,
  963.                                  Handle *                textH,
  964.                                  Handle *                styleH)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x002E, 0x7000, 0xA82A);
  965.  
  966.  
  967. enum {
  968.     kGetInstrumentInfoNoBuiltIn    = 1 << 0,
  969.     kGetInstrumentInfoMidiUserInst = 1 << 1,
  970.     kGetInstrumentInfoNoIText    = 1 << 2
  971. };
  972.  
  973. EXTERN_API( ComponentResult )
  974. MusicGetInstrumentInfo            (MusicComponent         mc,
  975.                                  long                     getInstrumentInfoFlags,
  976.                                  InstrumentInfoListHandle * infoListH)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x002F, 0x7000, 0xA82A);
  977.  
  978.  
  979.  
  980.  
  981. EXTERN_API( ComponentResult )
  982. MusicTask                        (MusicComponent         mc)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0031, 0x7000, 0xA82A);
  983.  
  984. EXTERN_API( ComponentResult )
  985. MusicSetPartInstrumentNumberInterruptSafe (MusicComponent  mc,
  986.                                  long                     part,
  987.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0032, 0x7000, 0xA82A);
  988.  
  989. EXTERN_API( ComponentResult )
  990. MusicSetPartSoundLocalization    (MusicComponent         mc,
  991.                                  long                     part,
  992.                                  Handle                 data)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0033, 0x7000, 0xA82A);
  993.  
  994. EXTERN_API( ComponentResult )
  995. MusicGenericConfigure            (MusicComponent         mc,
  996.                                  long                     mode,
  997.                                  long                     flags,
  998.                                  long                     baseResID)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  999.  
  1000. EXTERN_API( ComponentResult )
  1001. MusicGenericGetPart                (MusicComponent         mc,
  1002.                                  long                     partNumber,
  1003.                                  GCPart **                part)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0101, 0x7000, 0xA82A);
  1004.  
  1005. EXTERN_API( ComponentResult )
  1006. MusicGenericGetKnobList            (MusicComponent         mc,
  1007.                                  long                     knobType,
  1008.                                  GenericKnobDescriptionListHandle * gkdlH)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0102, 0x7000, 0xA82A);
  1009.  
  1010. EXTERN_API( ComponentResult )
  1011. MusicGenericSetResourceNumbers    (MusicComponent         mc,
  1012.                                  Handle                 resourceIDH)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  1013.  
  1014. EXTERN_API( ComponentResult )
  1015. MusicDerivedMIDISend            (MusicComponent         mc,
  1016.                                  MusicMIDIPacket *        packet)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  1017.  
  1018. EXTERN_API( ComponentResult )
  1019. MusicDerivedSetKnob                (MusicComponent         mc,
  1020.                                  long                     knobType,
  1021.                                  long                     knobNumber,
  1022.                                  long                     knobValue,
  1023.                                  long                     partNumber,
  1024.                                  GCPart *                p,
  1025.                                  GenericKnobDescription * gkd)                                FIVEWORDINLINE(0x2F3C, 0x0018, 0x0201, 0x7000, 0xA82A);
  1026.  
  1027. EXTERN_API( ComponentResult )
  1028. MusicDerivedSetPart                (MusicComponent         mc,
  1029.                                  long                     partNumber,
  1030.                                  GCPart *                p)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0202, 0x7000, 0xA82A);
  1031.  
  1032. EXTERN_API( ComponentResult )
  1033. MusicDerivedSetInstrument        (MusicComponent         mc,
  1034.                                  long                     partNumber,
  1035.                                  GCPart *                p)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0203, 0x7000, 0xA82A);
  1036.  
  1037. EXTERN_API( ComponentResult )
  1038. MusicDerivedSetPartInstrumentNumber (MusicComponent     mc,
  1039.                                  long                     partNumber,
  1040.                                  GCPart *                p)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0204, 0x7000, 0xA82A);
  1041.  
  1042. EXTERN_API( ComponentResult )
  1043. MusicDerivedSetMIDI                (MusicComponent         mc,
  1044.                                  MusicMIDISendUPP         midiProc,
  1045.                                  long                     refcon,
  1046.                                  long                     midiChannel)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0205, 0x7000, 0xA82A);
  1047.  
  1048. EXTERN_API( ComponentResult )
  1049. MusicDerivedStorePartInstrument    (MusicComponent         mc,
  1050.                                  long                     partNumber,
  1051.                                  GCPart *                p,
  1052.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x0206, 0x7000, 0xA82A);
  1053.  
  1054. EXTERN_API( ComponentResult )
  1055. MusicDerivedOpenResFile            (MusicComponent         mc)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0207, 0x7000, 0xA82A);
  1056.  
  1057. EXTERN_API( ComponentResult )
  1058. MusicDerivedCloseResFile        (MusicComponent         mc,
  1059.                                  short                     resRefNum)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0208, 0x7000, 0xA82A);
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. /* Mask bit for returned value by InstrumentFind.*/
  1067.  
  1068. enum {
  1069.     kInstrumentExactMatch        = 0x00020000,
  1070.     kInstrumentRecommendedSubstitute = 0x00010000,
  1071.     kInstrumentQualityField        = (long)0xFF000000,
  1072.     kInstrumentRoland8BitQuality = 0x05000000
  1073. };
  1074.  
  1075.  
  1076. typedef InstrumentAboutInfo *            InstrumentAboutInfoPtr;
  1077. typedef InstrumentAboutInfoPtr *        InstrumentAboutInfoHandle;
  1078.  
  1079. struct GMInstrumentInfo {
  1080.     long                             cmpInstID;
  1081.     long                             gmInstNum;
  1082.     long                             instMatch;
  1083. };
  1084. typedef struct GMInstrumentInfo            GMInstrumentInfo;
  1085. typedef GMInstrumentInfo *                GMInstrumentInfoPtr;
  1086. typedef GMInstrumentInfoPtr *            GMInstrumentInfoHandle;
  1087.  
  1088. struct nonGMInstrumentInfoRecord {
  1089.     long                             cmpInstID;                    /* if 0, category name*/
  1090.     long                             flags;                        /* match, show in picker*/
  1091.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  1092.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  1093. };
  1094. typedef struct nonGMInstrumentInfoRecord nonGMInstrumentInfoRecord;
  1095.  
  1096. struct nonGMInstrumentInfo {
  1097.     long                             recordCount;
  1098.     Handle                             toneNames;                    /* name from tone description*/
  1099.     QTAtomContainer                 itxtNames;                    /* itext/name atoms for instruments*/
  1100.     nonGMInstrumentInfoRecord         instInfo[1];
  1101. };
  1102. typedef struct nonGMInstrumentInfo        nonGMInstrumentInfo;
  1103. typedef nonGMInstrumentInfo *            nonGMInstrumentInfoPtr;
  1104. typedef nonGMInstrumentInfoPtr *        nonGMInstrumentInfoHandle;
  1105.  
  1106. struct InstCompInfo {
  1107.     long                             infoSize;                    /* size of this record*/
  1108.     Str31                             InstrumentLibraryName;
  1109.     QTAtomContainer                 InstrumentLibraryITxt;        /* itext/name atoms for instruments*/
  1110.     long                             GMinstrumentCount;
  1111.     GMInstrumentInfoHandle             GMinstrumentInfo;
  1112.     long                             GMdrumCount;
  1113.     GMInstrumentInfoHandle             GMdrumInfo;
  1114.     long                             nonGMinstrumentCount;
  1115.     nonGMInstrumentInfoHandle         nonGMinstrumentInfo;
  1116. };
  1117. typedef struct InstCompInfo                InstCompInfo;
  1118. typedef InstCompInfo *                    InstCompInfoPtr;
  1119. typedef InstCompInfoPtr *                InstCompInfoHandle;
  1120. EXTERN_API( ComponentResult )
  1121. InstrumentGetInst                (ComponentInstance         ci,
  1122.                                  long                     instID,
  1123.                                  AtomicInstrument *        atomicInst,
  1124.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0001, 0x7000, 0xA82A);
  1125.  
  1126. EXTERN_API( ComponentResult )
  1127. InstrumentGetInfo                (ComponentInstance         ci,
  1128.                                  long                     getInstrumentInfoFlags,
  1129.                                  InstCompInfoHandle *    instInfo)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  1130.  
  1131. EXTERN_API( ComponentResult )
  1132. InstrumentInitialize            (ComponentInstance         ci,
  1133.                                  long                     initFormat,
  1134.                                  void *                    initParams)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  1135.  
  1136. EXTERN_API( ComponentResult )
  1137. InstrumentOpenComponentResFile    (ComponentInstance         ci,
  1138.                                  short *                resFile)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1139.  
  1140. EXTERN_API( ComponentResult )
  1141. InstrumentCloseComponentResFile    (ComponentInstance         ci,
  1142.                                  short                     resFile)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0005, 0x7000, 0xA82A);
  1143.  
  1144. EXTERN_API( ComponentResult )
  1145. InstrumentGetComponentRefCon    (ComponentInstance         ci,
  1146.                                  void **                refCon)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1147.  
  1148. EXTERN_API( ComponentResult )
  1149. InstrumentSetComponentRefCon    (ComponentInstance         ci,
  1150.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1151.  
  1152. EXTERN_API( ComponentResult )
  1153. InstrumentGetSynthesizerType    (ComponentInstance         ci,
  1154.                                  OSType *                synthesizerType)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  1155.  
  1156.  
  1157.  
  1158. /*--------------------------
  1159.     Types
  1160. --------------------------*/
  1161.  
  1162. enum {
  1163.     kNoteRequestNoGM            = 1,                            /* dont degrade to a GM synth */
  1164.     kNoteRequestNoSynthType        = 2,                            /* dont degrade to another synth of same type but different name */
  1165.     kNoteRequestSynthMustMatch    = 4                                /* synthType must be a match, including kGMSynthComponentSubType */
  1166. };
  1167.  
  1168.  
  1169. typedef ComponentInstance                 NoteAllocator;
  1170.  
  1171. struct NoteRequestInfo {
  1172.     UInt8                             flags;                        /* 1: dont accept GM match, 2: dont accept same-synth-type match */
  1173.     UInt8                             reserved;                    /* must be zero */
  1174.     BigEndianShort                     polyphony;                    /* Maximum number of voices */
  1175.     BigEndianFixed                     typicalPolyphony;            /* Hint for level mixing */
  1176. };
  1177. typedef struct NoteRequestInfo            NoteRequestInfo;
  1178.  
  1179. struct NoteRequest {
  1180.     NoteRequestInfo                 info;
  1181.     ToneDescription                 tone;
  1182. };
  1183. typedef struct NoteRequest                NoteRequest;
  1184. typedef struct OpaqueNoteChannel*         NoteChannel;
  1185.  
  1186.  
  1187.  
  1188. enum {
  1189.     kPickDontMix                = 1,                            /* dont mix instruments with drum sounds */
  1190.     kPickSameSynth                = 2,                            /* only allow the same device that went in, to come out */
  1191.     kPickUserInsts                = 4,                            /* show user insts in addition to ROM voices */
  1192.     kPickEditAllowEdit            = 8,                            /* lets user switch over to edit mode */
  1193.     kPickEditAllowPick            = 16,                            /* lets the user switch over to pick mode */
  1194.     kPickEditSynthGlobal        = 32,                            /* edit the global knobs of the synth */
  1195.     kPickEditControllers        = 64                            /* edit the controllers of the notechannel */
  1196. };
  1197.  
  1198.  
  1199.  
  1200. enum {
  1201.     kNoteAllocatorComponentType    = FOUR_CHAR_CODE('nota')
  1202. };
  1203.  
  1204.  
  1205. /*--------------------------------
  1206.     Note Allocator Prototypes
  1207. --------------------------------*/
  1208. EXTERN_API( ComponentResult )
  1209. NARegisterMusicDevice            (NoteAllocator             na,
  1210.                                  OSType                 synthType,
  1211.                                  Str31                     name,
  1212.                                  SynthesizerConnections * connections)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0000, 0x7000, 0xA82A);
  1213.  
  1214. EXTERN_API( ComponentResult )
  1215. NAUnregisterMusicDevice            (NoteAllocator             na,
  1216.                                  long                     index)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1217.  
  1218. EXTERN_API( ComponentResult )
  1219. NAGetRegisteredMusicDevice        (NoteAllocator             na,
  1220.                                  long                     index,
  1221.                                  OSType *                synthType,
  1222.                                  Str31                     name,
  1223.                                  SynthesizerConnections * connections,
  1224.                                  MusicComponent *        mc)                                    FIVEWORDINLINE(0x2F3C, 0x0014, 0x0002, 0x7000, 0xA82A);
  1225.  
  1226. EXTERN_API( ComponentResult )
  1227. NASaveMusicConfiguration        (NoteAllocator             na)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  1228.  
  1229. EXTERN_API( ComponentResult )
  1230. NANewNoteChannel                (NoteAllocator             na,
  1231.                                  NoteRequest *            noteRequest,
  1232.                                  NoteChannel *            outChannel)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  1233.  
  1234. EXTERN_API( ComponentResult )
  1235. NADisposeNoteChannel            (NoteAllocator             na,
  1236.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1237.  
  1238. EXTERN_API( ComponentResult )
  1239. NAGetNoteChannelInfo            (NoteAllocator             na,
  1240.                                  NoteChannel             noteChannel,
  1241.                                  long *                    index,
  1242.                                  long *                    part)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  1243.  
  1244. EXTERN_API( ComponentResult )
  1245. NAPrerollNoteChannel            (NoteAllocator             na,
  1246.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1247.  
  1248. EXTERN_API( ComponentResult )
  1249. NAUnrollNoteChannel                (NoteAllocator             na,
  1250.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  1251.  
  1252.  
  1253. EXTERN_API( ComponentResult )
  1254. NASetNoteChannelVolume            (NoteAllocator             na,
  1255.                                  NoteChannel             noteChannel,
  1256.                                  Fixed                     volume)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1257.  
  1258. EXTERN_API( ComponentResult )
  1259. NAResetNoteChannel                (NoteAllocator             na,
  1260.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1261.  
  1262. EXTERN_API( ComponentResult )
  1263. NAPlayNote                        (NoteAllocator             na,
  1264.                                  NoteChannel             noteChannel,
  1265.                                  long                     pitch,
  1266.                                  long                     velocity)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x000D, 0x7000, 0xA82A);
  1267.  
  1268. EXTERN_API( ComponentResult )
  1269. NASetController                    (NoteAllocator             na,
  1270.                                  NoteChannel             noteChannel,
  1271.                                  long                     controllerNumber,
  1272.                                  long                     controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  1273.  
  1274. EXTERN_API( ComponentResult )
  1275. NASetKnob                        (NoteAllocator             na,
  1276.                                  NoteChannel             noteChannel,
  1277.                                  long                     knobNumber,
  1278.                                  long                     knobValue)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  1279.  
  1280. EXTERN_API( ComponentResult )
  1281. NAFindNoteChannelTone            (NoteAllocator             na,
  1282.                                  NoteChannel             noteChannel,
  1283.                                  ToneDescription *        td,
  1284.                                  long *                    instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  1285.  
  1286. EXTERN_API( ComponentResult )
  1287. NASetInstrumentNumber            (NoteAllocator             na,
  1288.                                  NoteChannel             noteChannel,
  1289.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0011, 0x7000, 0xA82A);
  1290.  
  1291.  
  1292.  
  1293. #if OLDROUTINENAMES
  1294. #define NASetNoteChannelInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1295. #define NASetInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1296. #endif
  1297. EXTERN_API( ComponentResult )
  1298. NAPickInstrument                (NoteAllocator             na,
  1299.                                  ModalFilterUPP         filterProc,
  1300.                                  StringPtr                 prompt,
  1301.                                  ToneDescription *        sd,
  1302.                                  unsigned long             flags,
  1303.                                  long                     refCon,
  1304.                                  long                     reserved1,
  1305.                                  long                     reserved2)                            FIVEWORDINLINE(0x2F3C, 0x001C, 0x0012, 0x7000, 0xA82A);
  1306.  
  1307. EXTERN_API( ComponentResult )
  1308. NAPickArrangement                (NoteAllocator             na,
  1309.                                  ModalFilterUPP         filterProc,
  1310.                                  StringPtr                 prompt,
  1311.                                  long                     zero1,
  1312.                                  long                     zero2,
  1313.                                  Track                     t,
  1314.                                  StringPtr                 songName)                            FIVEWORDINLINE(0x2F3C, 0x0018, 0x0013, 0x7000, 0xA82A);
  1315.  
  1316.  
  1317. EXTERN_API( ComponentResult )
  1318. NASetDefaultMIDIInput            (NoteAllocator             na,
  1319.                                  SynthesizerConnections * sc)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  1320.  
  1321. EXTERN_API( ComponentResult )
  1322. NAGetDefaultMIDIInput            (NoteAllocator             na,
  1323.                                  SynthesizerConnections * sc)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0016, 0x7000, 0xA82A);
  1324.  
  1325.  
  1326. EXTERN_API( ComponentResult )
  1327. NAUseDefaultMIDIInput            (NoteAllocator             na,
  1328.                                  MusicMIDIReadHookUPP     readHook,
  1329.                                  long                     refCon,
  1330.                                  unsigned long             flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  1331.  
  1332. EXTERN_API( ComponentResult )
  1333. NALoseDefaultMIDIInput            (NoteAllocator             na)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x001A, 0x7000, 0xA82A);
  1334.  
  1335. EXTERN_API( ComponentResult )
  1336. NAStuffToneDescription            (NoteAllocator             na,
  1337.                                  long                     gmNumber,
  1338.                                  ToneDescription *        td)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  1339.  
  1340. EXTERN_API( ComponentResult )
  1341. NACopyrightDialog                (NoteAllocator             na,
  1342.                                  PicHandle                 p,
  1343.                                  StringPtr                 author,
  1344.                                  StringPtr                 copyright,
  1345.                                  StringPtr                 other,
  1346.                                  StringPtr                 title,
  1347.                                  ModalFilterUPP         filterProc,
  1348.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x001C, 0x001C, 0x7000, 0xA82A);
  1349.  
  1350.  
  1351. /*
  1352.       kNADummyOneSelect = 29
  1353.       kNADummyTwoSelect = 30
  1354. */
  1355.  
  1356. EXTERN_API( ComponentResult )
  1357. NAGetIndNoteChannel                (NoteAllocator             na,
  1358.                                  long                     index,
  1359.                                  NoteChannel *            nc,
  1360.                                  long *                    seed)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x001F, 0x7000, 0xA82A);
  1361.  
  1362.  
  1363. EXTERN_API( ComponentResult )
  1364. NAGetMIDIPorts                    (NoteAllocator             na,
  1365.                                  QTMIDIPortListHandle *    inputPorts,
  1366.                                  QTMIDIPortListHandle *    outputPorts)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  1367.  
  1368. EXTERN_API( ComponentResult )
  1369. NAGetNoteRequest                (NoteAllocator             na,
  1370.                                  NoteChannel             noteChannel,
  1371.                                  NoteRequest *            nrOut)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  1372.  
  1373. EXTERN_API( ComponentResult )
  1374. NASendMIDI                        (NoteAllocator             na,
  1375.                                  NoteChannel             noteChannel,
  1376.                                  MusicMIDIPacket *        mp)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0023, 0x7000, 0xA82A);
  1377.  
  1378. EXTERN_API( ComponentResult )
  1379. NAPickEditInstrument            (NoteAllocator             na,
  1380.                                  ModalFilterUPP         filterProc,
  1381.                                  StringPtr                 prompt,
  1382.                                  long                     refCon,
  1383.                                  NoteChannel             nc,
  1384.                                  AtomicInstrument         ai,
  1385.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x0018, 0x0024, 0x7000, 0xA82A);
  1386.  
  1387. EXTERN_API( ComponentResult )
  1388. NANewNoteChannelFromAtomicInstrument (NoteAllocator     na,
  1389.                                  AtomicInstrumentPtr     instrument,
  1390.                                  long                     flags,
  1391.                                  NoteChannel *            outChannel)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0025, 0x7000, 0xA82A);
  1392.  
  1393. EXTERN_API( ComponentResult )
  1394. NASetAtomicInstrument            (NoteAllocator             na,
  1395.                                  NoteChannel             noteChannel,
  1396.                                  AtomicInstrumentPtr     instrument,
  1397.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0026, 0x7000, 0xA82A);
  1398.  
  1399.  
  1400.  
  1401. EXTERN_API( ComponentResult )
  1402. NAGetKnob                        (NoteAllocator             na,
  1403.                                  NoteChannel             noteChannel,
  1404.                                  long                     knobNumber,
  1405.                                  long *                    knobValue)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0028, 0x7000, 0xA82A);
  1406.  
  1407. EXTERN_API( ComponentResult )
  1408. NATask                            (NoteAllocator             na)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0029, 0x7000, 0xA82A);
  1409.  
  1410. EXTERN_API( ComponentResult )
  1411. NASetNoteChannelBalance            (NoteAllocator             na,
  1412.                                  NoteChannel             noteChannel,
  1413.                                  long                     balance)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x002A, 0x7000, 0xA82A);
  1414.  
  1415. EXTERN_API( ComponentResult )
  1416. NASetInstrumentNumberInterruptSafe (NoteAllocator         na,
  1417.                                  NoteChannel             noteChannel,
  1418.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  1419.  
  1420. EXTERN_API( ComponentResult )
  1421. NASetNoteChannelSoundLocalization (NoteAllocator         na,
  1422.                                  NoteChannel             noteChannel,
  1423.                                  Handle                 data)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  1424.  
  1425. EXTERN_API( ComponentResult )
  1426. NAGetController                    (NoteAllocator             na,
  1427.                                  NoteChannel             noteChannel,
  1428.                                  long                     controllerNumber,
  1429.                                  long *                    controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x002D, 0x7000, 0xA82A);
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436. enum {
  1437.     kTuneQueueDepth                = 8                                /* Deepest you can queue tune segments */
  1438. };
  1439.  
  1440.  
  1441.  
  1442. struct TuneStatus {
  1443.     unsigned long *                    tune;                        /* currently playing tune */
  1444.     unsigned long *                    tunePtr;                    /* position within currently playing piece */
  1445.     TimeValue                         time;                        /* current tune time */
  1446.     short                             queueCount;                    /* how many pieces queued up? */
  1447.     short                             queueSpots;                    /* How many more tunepieces can be queued */
  1448.     TimeValue                         queueTime;                    /* How much time is queued up? (can be very inaccurate) */
  1449.     long                             reserved[3];
  1450. };
  1451. typedef struct TuneStatus                TuneStatus;
  1452. typedef CALLBACK_API( void , TuneCallBackProcPtr )(const TuneStatus *status, long refCon);
  1453. typedef CALLBACK_API( void , TunePlayCallBackProcPtr )(unsigned long *event, long seed, long refCon);
  1454. typedef STACK_UPP_TYPE(TuneCallBackProcPtr)                     TuneCallBackUPP;
  1455. typedef STACK_UPP_TYPE(TunePlayCallBackProcPtr)                 TunePlayCallBackUPP;
  1456.  
  1457. typedef ComponentInstance                 TunePlayer;
  1458.  
  1459. enum {
  1460.     kTunePlayerComponentType    = FOUR_CHAR_CODE('tune')
  1461. };
  1462.  
  1463.  
  1464. EXTERN_API( ComponentResult )
  1465. TuneSetHeader                    (TunePlayer             tp,
  1466.                                  unsigned long *        header)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1467.  
  1468. EXTERN_API( ComponentResult )
  1469. TuneGetTimeBase                    (TunePlayer             tp,
  1470.                                  TimeBase *                tb)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1471.  
  1472. EXTERN_API( ComponentResult )
  1473. TuneSetTimeScale                (TunePlayer             tp,
  1474.                                  TimeScale                 scale)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1475.  
  1476. EXTERN_API( ComponentResult )
  1477. TuneGetTimeScale                (TunePlayer             tp,
  1478.                                  TimeScale *            scale)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1479.  
  1480. EXTERN_API( ComponentResult )
  1481. TuneGetIndexedNoteChannel        (TunePlayer             tp,
  1482.                                  long                     i,
  1483.                                  NoteChannel *            nc)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  1484.  
  1485.  
  1486. /* Values for when to start. */
  1487.  
  1488. enum {
  1489.     kTuneStartNow                = 1,                            /* start after buffer is implied */
  1490.     kTuneDontClipNotes            = 2,                            /* allow notes to finish their durations outside sample */
  1491.     kTuneExcludeEdgeNotes        = 4,                            /* dont play notes that start at end of tune */
  1492.     kTuneQuickStart                = 8,                            /* Leave all the controllers where they are, ignore start time */
  1493.     kTuneLoopUntil                = 16,                            /* loop a queued tune if there's nothing else in the queue*/
  1494.     kTunePlayDifference            = 32,                            /* by default, the tune difference is skipped*/
  1495.     kTunePlayConcurrent            = 64,                            /* dont block the next tune sequence with this one*/
  1496.     kTuneStartNewMaster            = 16384
  1497. };
  1498.  
  1499. EXTERN_API( ComponentResult )
  1500. TuneQueue                        (TunePlayer             tp,
  1501.                                  unsigned long *        tune,
  1502.                                  Fixed                     tuneRate,
  1503.                                  unsigned long             tuneStartPosition,
  1504.                                  unsigned long             tuneStopPosition,
  1505.                                  unsigned long             queueFlags,
  1506.                                  TuneCallBackUPP         callBackProc,
  1507.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x001C, 0x000A, 0x7000, 0xA82A);
  1508.  
  1509. EXTERN_API( ComponentResult )
  1510. TuneInstant                        (TunePlayer             tp,
  1511.                                  unsigned long *        tune,
  1512.                                  unsigned long             tunePosition)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1513.  
  1514. EXTERN_API( ComponentResult )
  1515. TuneGetStatus                    (TunePlayer             tp,
  1516.                                  TuneStatus *            status)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1517.  
  1518. /* Values for stopping. */
  1519.  
  1520. enum {
  1521.     kTuneStopFade                = 1,                            /* do a quick, synchronous fadeout */
  1522.     kTuneStopSustain            = 2,                            /* don't silece notes */
  1523.     kTuneStopInstant            = 4,                            /* silence notes fast (else, decay them) */
  1524.     kTuneStopReleaseChannels    = 8                                /* afterwards, let the channels go */
  1525. };
  1526.  
  1527. EXTERN_API( ComponentResult )
  1528. TuneStop                        (TunePlayer             tp,
  1529.                                  long                     stopFlags)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1530.  
  1531.  
  1532. EXTERN_API( ComponentResult )
  1533. TuneSetVolume                    (TunePlayer             tp,
  1534.                                  Fixed                     volume)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  1535.  
  1536. EXTERN_API( ComponentResult )
  1537. TuneGetVolume                    (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  1538.  
  1539. EXTERN_API( ComponentResult )
  1540. TunePreroll                        (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  1541.  
  1542. EXTERN_API( ComponentResult )
  1543. TuneUnroll                        (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  1544.  
  1545. EXTERN_API( ComponentResult )
  1546. TuneSetNoteChannels                (TunePlayer             tp,
  1547.                                  unsigned long             count,
  1548.                                  NoteChannel *            noteChannelList,
  1549.                                  TunePlayCallBackUPP     playCallBackProc,
  1550.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  1551.  
  1552. EXTERN_API( ComponentResult )
  1553. TuneSetPartTranspose            (TunePlayer             tp,
  1554.                                  unsigned long             part,
  1555.                                  long                     transpose,
  1556.                                  long                     velocityShift)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0015, 0x7000, 0xA82A);
  1557.  
  1558.  
  1559. EXTERN_API( NoteAllocator )
  1560. TuneGetNoteAllocator            (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0017, 0x7000, 0xA82A);
  1561.  
  1562. EXTERN_API( ComponentResult )
  1563. TuneSetSofter                    (TunePlayer             tp,
  1564.                                  long                     softer)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  1565.  
  1566. EXTERN_API( ComponentResult )
  1567. TuneTask                        (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0019, 0x7000, 0xA82A);
  1568.  
  1569. EXTERN_API( ComponentResult )
  1570. TuneSetBalance                    (TunePlayer             tp,
  1571.                                  long                     balance)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  1572.  
  1573. EXTERN_API( ComponentResult )
  1574. TuneSetSoundLocalization        (TunePlayer             tp,
  1575.                                  Handle                 data)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  1576.  
  1577. EXTERN_API( ComponentResult )
  1578. TuneSetHeaderWithSize            (TunePlayer             tp,
  1579.                                  unsigned long *        header,
  1580.                                  unsigned long             size)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  1581.  
  1582. /* flags for part mix. */
  1583.  
  1584. enum {
  1585.     kTuneMixMute                = 1,                            /* disable a part */
  1586.     kTuneMixSolo                = 2                                /* if any parts soloed, play only soloed parts */
  1587. };
  1588.  
  1589.  
  1590. EXTERN_API( ComponentResult )
  1591. TuneSetPartMix                    (TunePlayer             tp,
  1592.                                  unsigned long             partNumber,
  1593.                                  long                     volume,
  1594.                                  long                     balance,
  1595.                                  long                     mixFlags)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  1596.  
  1597. EXTERN_API( ComponentResult )
  1598. TuneGetPartMix                    (TunePlayer             tp,
  1599.                                  unsigned long             partNumber,
  1600.                                  long *                    volumeOut,
  1601.                                  long *                    balanceOut,
  1602.                                  long *                    mixFlagsOut)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x001E, 0x7000, 0xA82A);
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608. typedef unsigned long                     MusicOpWord;
  1609. typedef unsigned long *                    MusicOpWordPtr;
  1610. /*     QuickTime Music Track Event Formats:
  1611.  
  1612.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1613.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1614.     long CONTROL events, and variable GENERAL events.
  1615.  
  1616.         • REST Event (4 bytes/event):
  1617.     
  1618.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1619.         
  1620.         • Short NOTE Events (4 bytes/event):
  1621.     
  1622.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1623.         
  1624.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1625.  
  1626.         • Short CONTROL Events (4 bytes/event):
  1627.     
  1628.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1629.                                                                          ( or 15-bit Signed Value)
  1630.         • Short GENERAL Event (4 bytes/event):
  1631.     
  1632.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1633.     
  1634.         • Long NOTE Events (8 bytes/event):
  1635.     
  1636.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1637.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1638.         
  1639.         • Long CONTROL Event (8 bytes/event):
  1640.         
  1641.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1642.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1643.     
  1644.         • Long KNOB Event (8 bytes/event):
  1645.     
  1646.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1647.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1648.     
  1649.         • Variable GENERAL Length Events (N bytes/event):
  1650.     
  1651.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1652.                 :
  1653.             (32-bit Data values)
  1654.                 :
  1655.             (1 1) (14-bit UNUSED) (16-bit Length)
  1656.     
  1657.             where:    Length field is the number of LONG words in the record.
  1658.                     Lengths include the first and last long words (Minimum length = 2)
  1659.                 
  1660.     The following event type values have not been used yet and are reserved for 
  1661.     future expansion:
  1662.         
  1663.         • (1 0 0 0)        (8 bytes/event)
  1664.         • (1 1 0 0)        (N bytes/event)
  1665.         • (1 1 0 1)        (N bytes/event)
  1666.         • (1 1 1 0)        (N bytes/event)
  1667.         
  1668.     For all events, the following generalizations apply:
  1669.     
  1670.         -    All duration values are specified in Millisecond units.
  1671.         -     Pitch values are intended to map directly to the MIDI key numbers.
  1672.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1673.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1674.             Key Pressure, and Channel Pressure).    
  1675. */
  1676.  
  1677. /* Defines for the implemented music event data fields*/
  1678.  
  1679. enum {
  1680.     kRestEventType                = 0x00000000,                    /* lower 3-bits */
  1681.     kNoteEventType                = 0x00000001,                    /* lower 3-bits */
  1682.     kControlEventType            = 0x00000002,                    /* lower 3-bits */
  1683.     kMarkerEventType            = 0x00000003,                    /* lower 3-bits */
  1684.     kUndefined1EventType        = 0x00000008,                    /* 4-bits */
  1685.     kXNoteEventType                = 0x00000009,                    /* 4-bits */
  1686.     kXControlEventType            = 0x0000000A,                    /* 4-bits */
  1687.     kKnobEventType                = 0x0000000B,                    /* 4-bits */
  1688.     kUndefined2EventType        = 0x0000000C,                    /* 4-bits */
  1689.     kUndefined3EventType        = 0x0000000D,                    /* 4-bits */
  1690.     kUndefined4EventType        = 0x0000000E,                    /* 4-bits */
  1691.     kGeneralEventType            = 0x0000000F,                    /* 4-bits */
  1692.     kXEventLengthBits            = 0x00000002,                    /* 2 bits: indicates 8-byte event record */
  1693.     kGeneralEventLengthBits        = 0x00000003,                    /* 2 bits: indicates variable length event record */
  1694.     kEventLen                    = 1L,                            /* length of events in long words */
  1695.     kXEventLen                    = 2L,
  1696.     kRestEventLen                = kEventLen,                    /* length of events in long words */
  1697.     kNoteEventLen                = kEventLen,
  1698.     kControlEventLen            = kEventLen,
  1699.     kMarkerEventLen                = kEventLen,
  1700.     kXNoteEventLen                = kXEventLen,
  1701.     kXControlEventLen            = kXEventLen,
  1702.     kGeneralEventLen            = kXEventLen,                    /* 2 or more, however */
  1703.                                                                 /* Universal Event Defines*/
  1704.     kEventLengthFieldPos        = 30,                            /* by looking at these two bits of the 1st or last word              */
  1705.     kEventLengthFieldWidth        = 2,                            /* of an event you can determine the event length                      */
  1706.                                                                 /* length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length */
  1707.     kEventTypeFieldPos            = 29,                            /* event type field for short events */
  1708.     kEventTypeFieldWidth        = 3,                            /* short type is 3 bits */
  1709.     kXEventTypeFieldPos            = 28,                            /* event type field for extended events */
  1710.     kXEventTypeFieldWidth        = 4,                            /* extended type is 4 bits */
  1711.     kEventPartFieldPos            = 24,
  1712.     kEventPartFieldWidth        = 5,
  1713.     kXEventPartFieldPos            = 16,                            /* in the 1st long word */
  1714.     kXEventPartFieldWidth        = 12,                            /* Rest Events*/
  1715.     kRestEventDurationFieldPos    = 0,
  1716.     kRestEventDurationFieldWidth = 24,
  1717.     kRestEventDurationMax        = ((1L << kRestEventDurationFieldWidth) - 1), /* Note Events*/
  1718.     kNoteEventPitchFieldPos        = 18,
  1719.     kNoteEventPitchFieldWidth    = 6,
  1720.     kNoteEventPitchOffset        = 32,                            /* add to value in pitch field to get actual pitch */
  1721.     kNoteEventVolumeFieldPos    = 11,
  1722.     kNoteEventVolumeFieldWidth    = 7,
  1723.     kNoteEventVolumeOffset        = 0,                            /* add to value in volume field to get actual volume */
  1724.     kNoteEventDurationFieldPos    = 0,
  1725.     kNoteEventDurationFieldWidth = 11,
  1726.     kNoteEventDurationMax        = ((1L << kNoteEventDurationFieldWidth) - 1),
  1727.     kXNoteEventPitchFieldPos    = 0,                            /* in the 1st long word */
  1728.     kXNoteEventPitchFieldWidth    = 16,
  1729.     kXNoteEventDurationFieldPos    = 0,                            /* in the 2nd long word */
  1730.     kXNoteEventDurationFieldWidth = 22,
  1731.     kXNoteEventDurationMax        = ((1L << kXNoteEventDurationFieldWidth) - 1),
  1732.     kXNoteEventVolumeFieldPos    = 22,                            /* in the 2nd long word */
  1733.     kXNoteEventVolumeFieldWidth    = 7,                            /* Control Events*/
  1734.     kControlEventControllerFieldPos = 16,
  1735.     kControlEventControllerFieldWidth = 8,
  1736.     kControlEventValueFieldPos    = 0,
  1737.     kControlEventValueFieldWidth = 16,
  1738.     kXControlEventControllerFieldPos = 0,                        /* in the 2nd long word */
  1739.     kXControlEventControllerFieldWidth = 16,
  1740.     kXControlEventValueFieldPos    = 0,                            /* in the 1st long word */
  1741.     kXControlEventValueFieldWidth = 16,                            /* Knob Events*/
  1742.     kKnobEventValueHighFieldPos    = 0,                            /* 1st long word */
  1743.     kKnobEventValueHighFieldWidth = 16,
  1744.     kKnobEventKnobFieldPos        = 16,                            /* 2nd long word */
  1745.     kKnobEventKnobFieldWidth    = 14,
  1746.     kKnobEventValueLowFieldPos    = 0,                            /* 2nd long word */
  1747.     kKnobEventValueLowFieldWidth = 16,                            /* Marker Events*/
  1748.     kMarkerEventSubtypeFieldPos    = 16,
  1749.     kMarkerEventSubtypeFieldWidth = 8,
  1750.     kMarkerEventValueFieldPos    = 0,
  1751.     kMarkerEventValueFieldWidth    = 16,                            /* General Events*/
  1752.     kGeneralEventSubtypeFieldPos = 16,                            /* in the last long word */
  1753.     kGeneralEventSubtypeFieldWidth = 14,
  1754.     kGeneralEventLengthFieldPos    = 0,                            /* in the 1st & last long words */
  1755.     kGeneralEventLengthFieldWidth = 16
  1756. };
  1757.  
  1758. #if TARGET_RT_LITTLE_ENDIAN
  1759.  
  1760. enum {
  1761.     kEndMarkerValue                = 0x00000060
  1762. };
  1763.  
  1764. #else
  1765.  
  1766. enum {
  1767.     kEndMarkerValue                = 0x60000000
  1768. };
  1769.  
  1770. #endif  /* TARGET_RT_LITTLE_ENDIAN */
  1771.  
  1772. /* macros for extracting various fields from the QuickTime event records*/
  1773. #define qtma_MASK(bitWidth)             ((1L << (bitWidth)) - 1)
  1774. #define qtma_EXT(val, pos, width)         ((EndianU32_BtoN(val) >> (pos)) & qtma_MASK(width))
  1775. #define qtma_EventLengthForward(xP,ulen)        \
  1776.     {                                            \
  1777.         unsigned long _ext;                            \
  1778.         unsigned long *lP = (unsigned long *)(xP);    \
  1779.         _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth); \
  1780.         if (_ext != 3) {                        \
  1781.             ulen = (_ext < 2) ? 1 : 2;            \
  1782.         } else {                                \
  1783.             ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth); \
  1784.             if (ulen < 2) {                        \
  1785.                 ulen = lP[1];                    \
  1786.             }                                    \
  1787.         }                                        \
  1788.     }
  1789. #define qtma_EventLengthBackward(xP,ulen)        \
  1790.     {                                            \
  1791.         unsigned long _ext;                        \
  1792.         unsigned long *lP = (unsigned long *)(xP); \
  1793.         _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth);        \
  1794.         if (_ext != 3) {                        \
  1795.             ulen = (_ext < 2) ? 1 : 2;            \
  1796.         } else {                                \
  1797.             ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth);        \
  1798.             if (ulen < 2) {                        \
  1799.                 ulen = lP[-1];                    \
  1800.             }                                    \
  1801.         }                                        \
  1802.     }
  1803. #define qtma_EventType(x)                 ((qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? qtma_EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  1804. #define qtma_RestDuration(x)              (qtma_EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  1805. #define qtma_Part(x)                     (qtma_EXT(x, kEventPartFieldPos, kEventPartFieldWidth))
  1806. #define qtma_XPart(m, l)                 (qtma_EXT(m, kXEventPartFieldPos, kXEventPartFieldWidth))
  1807. #define qtma_NotePitch(x)                 (qtma_EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  1808. #define qtma_NoteVolume(x)                 (qtma_EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  1809. #define qtma_NoteDuration(x)             (qtma_EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  1810. #define qtma_NoteVelocity qtma_NoteVolume
  1811. #define qtma_XNotePitch(m, l)             (qtma_EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  1812. #define qtma_XNoteVolume(m, l)             (qtma_EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  1813. #define qtma_XNoteDuration(m, l)         (qtma_EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  1814. #define qtma_XNoteVelocity qtma_XNoteVolume
  1815. #define qtma_ControlController(x)         (qtma_EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  1816. #define qtma_ControlValue(x)             (qtma_EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  1817. #define qtma_XControlController(m, l)     (qtma_EXT(l, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  1818. #define qtma_XControlValue(m, l)         (qtma_EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  1819. #define qtma_MarkerSubtype(x)            (qtma_EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  1820. #define qtma_MarkerValue(x)             (qtma_EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  1821.  
  1822. #define qtma_KnobValue(m,l)                ((qtma_EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16)    \
  1823.                                         | (qtma_EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  1824.  
  1825. #define qtma_KnobKnob(m,l)                (qtma_EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  1826. #define qtma_GeneralSubtype(m,l)        (qtma_EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  1827. #define qtma_GeneralLength(m,l)           (qtma_EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  1828. #define qtma_StuffRestEvent(x, duration) ( \
  1829.     x =       (kRestEventType << kEventTypeFieldPos)    \
  1830.         |  ((long)(duration) << kRestEventDurationFieldPos),    \
  1831.     x = EndianU32_NtoB(x) )
  1832. #define qtma_StuffNoteEvent(x, part, pitch, volume, duration) ( \
  1833.     x =        (kNoteEventType << kEventTypeFieldPos)    \
  1834.         |     ((long)(part) << kEventPartFieldPos)    \
  1835.         |    (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos)    \
  1836.         |    (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos)    \
  1837.         |    ((long)(duration) << kNoteEventDurationFieldPos), \
  1838.     x = EndianU32_NtoB(x) )
  1839. #define qtma_StuffControlEvent(x, part, control, value) ( \
  1840.     x =        (kControlEventType << kEventTypeFieldPos)            \
  1841.         |     ((long)(part) << kEventPartFieldPos)                \
  1842.         |    ((long)(control) << kControlEventControllerFieldPos)\
  1843.         |    ((long)((value) & qtma_MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos), \
  1844.     x = EndianU32_NtoB(x) )
  1845. #define qtma_StuffMarkerEvent(x, markerType, markerValue) ( \
  1846.     x =     (kMarkerEventType << kEventTypeFieldPos)    \
  1847.         |     ((long)(markerType) << kMarkerEventSubtypeFieldPos)    \
  1848.         |    ((long)(markerValue) << kMarkerEventValueFieldPos), \
  1849.     x = EndianU32_NtoB(x) )
  1850. #define qtma_StuffXNoteEvent(w1, w2, part, pitch, volume, duration) ( \
  1851.     w1 =     (kXNoteEventType << kXEventTypeFieldPos)            \
  1852.         |    ((long)(part) << kXEventPartFieldPos)                \
  1853.         |    ((long)(pitch) << kXNoteEventPitchFieldPos),        \
  1854.     w1 = EndianU32_NtoB(w1),                                    \
  1855.     w2 =     (kXEventLengthBits << kEventLengthFieldPos)        \
  1856.         |    ((long)(duration) << kXNoteEventDurationFieldPos)    \
  1857.         |    ((long)(volume) << kXNoteEventVolumeFieldPos),        \
  1858.     w2 = EndianU32_NtoB(w2) )
  1859. #define qtma_StuffXControlEvent(w1, w2, part, control, value) (        \
  1860.     w1 =     (kXControlEventType << kXEventTypeFieldPos)                \
  1861.         |    ((long)(part) << kXEventPartFieldPos)                    \
  1862.         |    ((long)((value) & qtma_MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos), \
  1863.     w1 = EndianU32_NtoB(w1),                                        \
  1864.     w2 =     (kXEventLengthBits << kEventLengthFieldPos)                \
  1865.         |    ((long)(control) << kXControlEventControllerFieldPos),    \
  1866.     w2 = EndianU32_NtoB(w2) )
  1867. #define qtma_StuffKnobEvent(w1, w2, part, knob, value) ( \
  1868.     w1 =     (kKnobEventType << kXEventTypeFieldPos)                    \
  1869.         |    ((long)(part) << kXEventPartFieldPos)                    \
  1870.         |    ((long)(value >> 16) << kKnobEventValueLowFieldPos),    \
  1871.     w1 = EndianU32_NtoB(w1),                                        \
  1872.     w2 =     (kXEventLengthBits << kEventLengthFieldPos)                \
  1873.         |    ((long)(knob) << kKnobEventKnobFieldPos)                \
  1874.         |    ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos), \
  1875.     w2 = EndianU32_NtoB(w2) )
  1876. #define qtma_StuffGeneralEvent(w1,w2,part,subType,length) ( \
  1877.     w1 =    (kGeneralEventType << kXEventTypeFieldPos)                \
  1878.         |    ((long)(part) << kXEventPartFieldPos)                    \
  1879.         |    ((long)(length) << kGeneralEventLengthFieldPos),        \
  1880.     w1 = EndianU32_NtoB(w1),                                        \
  1881.     w2 = (kGeneralEventLengthBits << kEventLengthFieldPos)            \
  1882.         |    ((long)(subType) << kGeneralEventSubtypeFieldPos)        \
  1883.         |    ((long)(length) << kGeneralEventLengthFieldPos),        \
  1884.     w2 = EndianU32_NtoB(w2) )
  1885. #define qtma_NeedXGeneralEvent(length)     (((unsigned long)(length)) > (unsigned long)0xffff)
  1886. /* General Event Defined Types*/
  1887.  
  1888. enum {
  1889.     kGeneralEventNoteRequest    = 1,                            /* Encapsulates NoteRequest data structure */
  1890.     kGeneralEventPartKey        = 4,
  1891.     kGeneralEventTuneDifference    = 5,                            /* Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music) */
  1892.     kGeneralEventAtomicInstrument = 6,                            /* Encapsulates AtomicInstrument record */
  1893.     kGeneralEventKnob            = 7,                            /* knobID/knobValue pairs; smallest event is 4 longs */
  1894.     kGeneralEventMIDIChannel    = 8,                            /* used in tune header, one longword identifies the midi channel it originally came from */
  1895.     kGeneralEventPartChange        = 9,                            /* used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music)*/
  1896.     kGeneralEventNoOp            = 10,                            /* guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music) */
  1897.     kGeneralEventUsedNotes        = 11,                            /* four longwords specifying which midi notes are actually used, 0..127 msb to lsb */
  1898.     kGeneralEventPartMix        = 12                            /* three longwords: Fixed volume, long balance, long flags */
  1899. };
  1900.  
  1901. /* Marker Event Defined Types        // marker is 60 ee vv vv in hex, where e = event type, and v = value*/
  1902.  
  1903. enum {
  1904.     kMarkerEventEnd                = 0,                            /* marker type 0 means: value 0 - stop, value != 0 - ignore*/
  1905.     kMarkerEventBeat            = 1,                            /* value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note)*/
  1906.     kMarkerEventTempo            = 2                                /* value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export*/
  1907. };
  1908.  
  1909.  
  1910. enum {
  1911.     kCurrentlyNativeEndian        = 1,
  1912.     kCurrentlyNotNativeEndian    = 2
  1913. };
  1914.  
  1915. /* UPP call backs */
  1916. enum { uppMusicMIDISendProcInfo = 0x00000FF0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1917. enum { uppMusicMIDIReadHookProcInfo = 0x000003F0 };             /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  1918. enum { uppMusicOfflineDataProcInfo = 0x00000FF0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1919. enum { uppTuneCallBackProcInfo = 0x000003C0 };                     /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1920. enum { uppTunePlayCallBackProcInfo = 0x00000FC0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  1921. #define NewMusicMIDISendProc(userRoutine)                         (MusicMIDISendUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture())
  1922. #define NewMusicMIDIReadHookProc(userRoutine)                     (MusicMIDIReadHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, GetCurrentArchitecture())
  1923. #define NewMusicOfflineDataProc(userRoutine)                     (MusicOfflineDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, GetCurrentArchitecture())
  1924. #define NewTuneCallBackProc(userRoutine)                         (TuneCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture())
  1925. #define NewTunePlayCallBackProc(userRoutine)                     (TunePlayCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture())
  1926. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)     CALL_THREE_PARAMETER_UPP((userRoutine), uppMusicMIDISendProcInfo, (self), (refCon), (mmp))
  1927. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)     CALL_TWO_PARAMETER_UPP((userRoutine), uppMusicMIDIReadHookProcInfo, (mp), (myRefCon))
  1928. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppMusicOfflineDataProcInfo, (SoundData), (numBytes), (myRefCon))
  1929. #define CallTuneCallBackProc(userRoutine, status, refCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppTuneCallBackProcInfo, (status), (refCon))
  1930. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppTunePlayCallBackProcInfo, (event), (seed), (refCon))
  1931.  
  1932. /* selectors for component calls */
  1933. enum {
  1934.     kQTMIDIGetMIDIPortsSelect                        = 0x0001,
  1935.     kQTMIDIUseSendPortSelect                        = 0x0002,
  1936.     kQTMIDISendMIDISelect                            = 0x0003,
  1937.     kQTMIDIUseReceivePortSelect                        = 0x0004,
  1938.     kMusicGetDescriptionSelect                        = 0x0001,
  1939.     kMusicGetPartSelect                                = 0x0002,
  1940.     kMusicSetPartSelect                                = 0x0003,
  1941.     kMusicSetPartInstrumentNumberSelect                = 0x0004,
  1942.     kMusicGetPartInstrumentNumberSelect                = 0x0005,
  1943.     kMusicStorePartInstrumentSelect                    = 0x0006,
  1944.     kMusicGetPartAtomicInstrumentSelect                = 0x0009,
  1945.     kMusicSetPartAtomicInstrumentSelect                = 0x000A,
  1946.     kMusicGetInstrumentKnobDescriptionObsoleteSelect = 0x000D,
  1947.     kMusicGetDrumKnobDescriptionObsoleteSelect        = 0x000E,
  1948.     kMusicGetKnobDescriptionObsoleteSelect            = 0x000F,
  1949.     kMusicGetPartKnobSelect                            = 0x0010,
  1950.     kMusicSetPartKnobSelect                            = 0x0011,
  1951.     kMusicGetKnobSelect                                = 0x0012,
  1952.     kMusicSetKnobSelect                                = 0x0013,
  1953.     kMusicGetPartNameSelect                            = 0x0014,
  1954.     kMusicSetPartNameSelect                            = 0x0015,
  1955.     kMusicFindToneSelect                            = 0x0016,
  1956.     kMusicPlayNoteSelect                            = 0x0017,
  1957.     kMusicResetPartSelect                            = 0x0018,
  1958.     kMusicSetPartControllerSelect                    = 0x0019,
  1959.     kMusicGetPartControllerSelect                    = 0x001A,
  1960.     kMusicGetMIDIProcSelect                            = 0x001B,
  1961.     kMusicSetMIDIProcSelect                            = 0x001C,
  1962.     kMusicGetInstrumentNamesSelect                    = 0x001D,
  1963.     kMusicGetDrumNamesSelect                        = 0x001E,
  1964.     kMusicGetMasterTuneSelect                        = 0x001F,
  1965.     kMusicSetMasterTuneSelect                        = 0x0020,
  1966.     kMusicGetInstrumentAboutInfoSelect                = 0x0022,
  1967.     kMusicGetDeviceConnectionSelect                    = 0x0023,
  1968.     kMusicUseDeviceConnectionSelect                    = 0x0024,
  1969.     kMusicGetKnobSettingStringsSelect                = 0x0025,
  1970.     kMusicGetMIDIPortsSelect                        = 0x0026,
  1971.     kMusicSendMIDISelect                            = 0x0027,
  1972.     kMusicReceiveMIDISelect                            = 0x0028,
  1973.     kMusicStartOfflineSelect                        = 0x0029,
  1974.     kMusicSetOfflineTimeToSelect                    = 0x002A,
  1975.     kMusicGetInstrumentKnobDescriptionSelect        = 0x002B,
  1976.     kMusicGetDrumKnobDescriptionSelect                = 0x002C,
  1977.     kMusicGetKnobDescriptionSelect                    = 0x002D,
  1978.     kMusicGetInfoTextSelect                            = 0x002E,
  1979.     kMusicGetInstrumentInfoSelect                    = 0x002F,
  1980.     kMusicTaskSelect                                = 0x0031,
  1981.     kMusicSetPartInstrumentNumberInterruptSafeSelect = 0x0032,
  1982.     kMusicSetPartSoundLocalizationSelect            = 0x0033,
  1983.     kMusicGenericConfigureSelect                    = 0x0100,
  1984.     kMusicGenericGetPartSelect                        = 0x0101,
  1985.     kMusicGenericGetKnobListSelect                    = 0x0102,
  1986.     kMusicGenericSetResourceNumbersSelect            = 0x0103,
  1987.     kMusicDerivedMIDISendSelect                        = 0x0200,
  1988.     kMusicDerivedSetKnobSelect                        = 0x0201,
  1989.     kMusicDerivedSetPartSelect                        = 0x0202,
  1990.     kMusicDerivedSetInstrumentSelect                = 0x0203,
  1991.     kMusicDerivedSetPartInstrumentNumberSelect        = 0x0204,
  1992.     kMusicDerivedSetMIDISelect                        = 0x0205,
  1993.     kMusicDerivedStorePartInstrumentSelect            = 0x0206,
  1994.     kMusicDerivedOpenResFileSelect                    = 0x0207,
  1995.     kMusicDerivedCloseResFileSelect                    = 0x0208,
  1996.     kInstrumentGetInstSelect                        = 0x0001,
  1997.     kInstrumentGetInfoSelect                        = 0x0002,
  1998.     kInstrumentInitializeSelect                        = 0x0003,
  1999.     kInstrumentOpenComponentResFileSelect            = 0x0004,
  2000.     kInstrumentCloseComponentResFileSelect            = 0x0005,
  2001.     kInstrumentGetComponentRefConSelect                = 0x0006,
  2002.     kInstrumentSetComponentRefConSelect                = 0x0007,
  2003.     kInstrumentGetSynthesizerTypeSelect                = 0x0008,
  2004.     kNARegisterMusicDeviceSelect                    = 0x0000,
  2005.     kNAUnregisterMusicDeviceSelect                    = 0x0001,
  2006.     kNAGetRegisteredMusicDeviceSelect                = 0x0002,
  2007.     kNASaveMusicConfigurationSelect                    = 0x0003,
  2008.     kNANewNoteChannelSelect                            = 0x0004,
  2009.     kNADisposeNoteChannelSelect                        = 0x0005,
  2010.     kNAGetNoteChannelInfoSelect                        = 0x0006,
  2011.     kNAPrerollNoteChannelSelect                        = 0x0007,
  2012.     kNAUnrollNoteChannelSelect                        = 0x0008,
  2013.     kNASetNoteChannelVolumeSelect                    = 0x000B,
  2014.     kNAResetNoteChannelSelect                        = 0x000C,
  2015.     kNAPlayNoteSelect                                = 0x000D,
  2016.     kNASetControllerSelect                            = 0x000E,
  2017.     kNASetKnobSelect                                = 0x000F,
  2018.     kNAFindNoteChannelToneSelect                    = 0x0010,
  2019.     kNASetInstrumentNumberSelect                    = 0x0011,
  2020.     kNAPickInstrumentSelect                            = 0x0012,
  2021.     kNAPickArrangementSelect                        = 0x0013,
  2022.     kNASetDefaultMIDIInputSelect                    = 0x0015,
  2023.     kNAGetDefaultMIDIInputSelect                    = 0x0016,
  2024.     kNAUseDefaultMIDIInputSelect                    = 0x0019,
  2025.     kNALoseDefaultMIDIInputSelect                    = 0x001A,
  2026.     kNAStuffToneDescriptionSelect                    = 0x001B,
  2027.     kNACopyrightDialogSelect                        = 0x001C,
  2028.     kNAGetIndNoteChannelSelect                        = 0x001F,
  2029.     kNAGetMIDIPortsSelect                            = 0x0021,
  2030.     kNAGetNoteRequestSelect                            = 0x0022,
  2031.     kNASendMIDISelect                                = 0x0023,
  2032.     kNAPickEditInstrumentSelect                        = 0x0024,
  2033.     kNANewNoteChannelFromAtomicInstrumentSelect        = 0x0025,
  2034.     kNASetAtomicInstrumentSelect                    = 0x0026,
  2035.     kNAGetKnobSelect                                = 0x0028,
  2036.     kNATaskSelect                                    = 0x0029,
  2037.     kNASetNoteChannelBalanceSelect                    = 0x002A,
  2038.     kNASetInstrumentNumberInterruptSafeSelect        = 0x002B,
  2039.     kNASetNoteChannelSoundLocalizationSelect        = 0x002C,
  2040.     kNAGetControllerSelect                            = 0x002D,
  2041.     kTuneSetHeaderSelect                            = 0x0004,
  2042.     kTuneGetTimeBaseSelect                            = 0x0005,
  2043.     kTuneSetTimeScaleSelect                            = 0x0006,
  2044.     kTuneGetTimeScaleSelect                            = 0x0007,
  2045.     kTuneGetIndexedNoteChannelSelect                = 0x0008,
  2046.     kTuneQueueSelect                                = 0x000A,
  2047.     kTuneInstantSelect                                = 0x000B,
  2048.     kTuneGetStatusSelect                            = 0x000C,
  2049.     kTuneStopSelect                                    = 0x000D,
  2050.     kTuneSetVolumeSelect                            = 0x0010,
  2051.     kTuneGetVolumeSelect                            = 0x0011,
  2052.     kTunePrerollSelect                                = 0x0012,
  2053.     kTuneUnrollSelect                                = 0x0013,
  2054.     kTuneSetNoteChannelsSelect                        = 0x0014,
  2055.     kTuneSetPartTransposeSelect                        = 0x0015,
  2056.     kTuneGetNoteAllocatorSelect                        = 0x0017,
  2057.     kTuneSetSofterSelect                            = 0x0018,
  2058.     kTuneTaskSelect                                    = 0x0019,
  2059.     kTuneSetBalanceSelect                            = 0x001A,
  2060.     kTuneSetSoundLocalizationSelect                    = 0x001B,
  2061.     kTuneSetHeaderWithSizeSelect                    = 0x001C,
  2062.     kTuneSetPartMixSelect                            = 0x001D,
  2063.     kTuneGetPartMixSelect                            = 0x001E
  2064. };
  2065.  
  2066.  
  2067. #if PRAGMA_STRUCT_ALIGN
  2068.     #pragma options align=reset
  2069. #elif PRAGMA_STRUCT_PACKPUSH
  2070.     #pragma pack(pop)
  2071. #elif PRAGMA_STRUCT_PACK
  2072.     #pragma pack()
  2073. #endif
  2074.  
  2075. #ifdef PRAGMA_IMPORT_OFF
  2076. #pragma import off
  2077. #elif PRAGMA_IMPORT
  2078. #pragma import reset
  2079. #endif
  2080.  
  2081. #ifdef __cplusplus
  2082. }
  2083. #endif
  2084.  
  2085. #endif /* __QUICKTIMEMUSIC__ */
  2086.  
  2087.